瀏覽代碼

添加模型, 活动接口, 产品接口

chenxiqiang 7 年之前
父節點
當前提交
37bebe3e19

+ 5
- 1
manage-server/app/Models/Campaign.php 查看文件

4
 
4
 
5
 use Illuminate\Database\Eloquent\Model;
5
 use Illuminate\Database\Eloquent\Model;
6
 
6
 
7
+
7
 /**
8
 /**
9
+ * Class Campaign
10
+ * @package App\Models
8
  * 活动信息
11
  * 活动信息
9
  */
12
  */
10
 class Campaign extends Model
13
 class Campaign extends Model
12
     protected $fillable = [
15
     protected $fillable = [
13
     	'title', // 活动标题
16
     	'title', // 活动标题
14
 		'content', // 活动内容
17
 		'content', // 活动内容
15
-		'status']; // 活动状态
18
+		'status' // 活动状态
19
+    ];
16
 }
20
 }

manage-server/app/Models/HouseAppliancesCleanOrder.php → manage-server/app/Models/HouseApplianceCleanOrder.php 查看文件

5
 use Illuminate\Database\Eloquent\Model;
5
 use Illuminate\Database\Eloquent\Model;
6
 
6
 
7
 /**
7
 /**
8
+ * Class HouseApplianceCleanOrder
9
+ * @package App\Models
8
  * 家电清洁
10
  * 家电清洁
9
  */
11
  */
10
-class HouseAppliancesCleanOrder extends Model
12
+class HouseApplianceCleanOrder extends Model
11
 {
13
 {
12
     protected $fillable = [
14
     protected $fillable = [
13
-    	'wechat_id', // 微信号
15
+        'wechat_id', // 微信号id(open_id)
14
 		'appliances', // 项目, 数组形式,多个数量则出现多次
16
 		'appliances', // 项目, 数组形式,多个数量则出现多次
15
     	'address', // 服务地址
17
     	'address', // 服务地址
16
     	'contact', // 联系人
18
     	'contact', // 联系人
17
     	'phone',	//联系电话
19
     	'phone',	//联系电话
18
-    	'status']; // 订单状态
20
+    	'status', // 订单状态
21
+        'price' // 订单价格
22
+    ];
19
 }
23
 }

+ 6
- 2
manage-server/app/Models/HouseCleanOrder.php 查看文件

5
 use Illuminate\Database\Eloquent\Model;
5
 use Illuminate\Database\Eloquent\Model;
6
 
6
 
7
 /**
7
 /**
8
+ * Class HouseCleanOrder
9
+ * @package App\Models
8
  * 家居清洁订单
10
  * 家居清洁订单
9
  */
11
  */
10
 class HouseCleanOrder extends Model
12
 class HouseCleanOrder extends Model
11
 {
13
 {
12
     protected $fillable = [
14
     protected $fillable = [
13
-    	'wechat_id', // 微信号
15
+        'wechat_id', // 微信号id(open_id)
14
 		'type', // 清洁类型
16
 		'type', // 清洁类型
15
 		'area', // 清洁面积
17
 		'area', // 清洁面积
16
     	'address', // 服务地址
18
     	'address', // 服务地址
21
 		'picture3', // 图片3, 保持的是服务器上的图片地址
23
 		'picture3', // 图片3, 保持的是服务器上的图片地址
22
 		'picture4', // 图片4, 保持的是服务器上的图片地址
24
 		'picture4', // 图片4, 保持的是服务器上的图片地址
23
 		'picture5', // 图片5, 保持的是服务器上的图片地址
25
 		'picture5', // 图片5, 保持的是服务器上的图片地址
24
-    	'status']; // 订单状态
26
+    	'status', // 订单状态
27
+        'price' // 订单价格
28
+    ];
25
 }
29
 }

+ 6
- 2
manage-server/app/Models/HousekeeperOrder.php 查看文件

5
 use Illuminate\Database\Eloquent\Model;
5
 use Illuminate\Database\Eloquent\Model;
6
 
6
 
7
 /**
7
 /**
8
+ * Class HousekeeperOrder
9
+ * @package App\Models
8
  * 保姆订单
10
  * 保姆订单
9
  */
11
  */
10
 class HousekeeperOrder extends Model
12
 class HousekeeperOrder extends Model
11
 {
13
 {
12
     protected $fillable = [
14
     protected $fillable = [
13
-    	'wechat_id', // 微信号
15
+        'wechat_id', // 微信号id(open_id)
14
 		'appliances', // 项目, 数组形式,多个数量则出现多次
16
 		'appliances', // 项目, 数组形式,多个数量则出现多次
15
     	'address', // 服务地址
17
     	'address', // 服务地址
16
     	'contact', // 联系人
18
     	'contact', // 联系人
17
     	'phone',	//联系电话
19
     	'phone',	//联系电话
18
-    	'status']; // 订单状态
20
+        'status', // 订单状态
21
+        'price' // 订单价格
22
+    ];
19
 }
23
 }

+ 17
- 1
manage-server/app/Models/MaternityMatronOrder.php 查看文件

4
 
4
 
5
 use Illuminate\Database\Eloquent\Model;
5
 use Illuminate\Database\Eloquent\Model;
6
 
6
 
7
+/**
8
+ * Class MaternityMatronOrder
9
+ * @package App\Models
10
+ * 月嫂订单
11
+ */
7
 class MaternityMatronOrder extends Model
12
 class MaternityMatronOrder extends Model
8
 {
13
 {
9
-    //
14
+    protected $fillable = [
15
+        'wechat_id', // 微信号id(open_id)
16
+        'level', // 月嫂等级
17
+        'expected_date', // 预产期
18
+        'server_time', // 服务时间
19
+        'special_demand', // 特殊需求
20
+        'address', // 服务地址
21
+        'contact', // 联系人
22
+        'phone',	//联系电话
23
+        'status', // 订单状态
24
+        'price' // 订单价格
25
+    ];
10
 }
26
 }

+ 2
- 0
manage-server/app/Models/Product.php 查看文件

5
 use Illuminate\Database\Eloquent\Model;
5
 use Illuminate\Database\Eloquent\Model;
6
 
6
 
7
 /**
7
 /**
8
+ * Class Product
9
+ * @package App\Models
8
  * 产品信息
10
  * 产品信息
9
  */
11
  */
10
 class Product extends Model
12
 class Product extends Model

+ 5
- 2
manage-server/app/Models/ProductOrder.php 查看文件

5
 use Illuminate\Database\Eloquent\Model;
5
 use Illuminate\Database\Eloquent\Model;
6
 
6
 
7
 /**
7
 /**
8
- * 产品信息
8
+ * Class ProductOrder
9
+ * @package App\Models
10
+ * 产品订单
9
  */
11
  */
10
 class ProductOrder extends Model
12
 class ProductOrder extends Model
11
 {
13
 {
12
     protected $fillable = [
14
     protected $fillable = [
15
+        'wechat_id', // 微信号id(open_id)
13
     	'product_id', // 产品名称
16
     	'product_id', // 产品名称
14
 		'product_name', // 产品信息
17
 		'product_name', // 产品信息
15
 		'unit', // 产品单格
18
 		'unit', // 产品单格
20
 		'info', // 卖家信息
23
 		'info', // 卖家信息
21
 		'contact', // 买家联系人
24
 		'contact', // 买家联系人
22
 		'address', // 买家地址
25
 		'address', // 买家地址
23
-		'phone', // 买家手机号码
26
+		'phone' // 买家手机号码
24
 	];
27
 	];
25
 }
28
 }

+ 2
- 1
manage-server/app/Providers/AppServiceProvider.php 查看文件

3
 namespace App\Providers;
3
 namespace App\Providers;
4
 
4
 
5
 use Illuminate\Support\ServiceProvider;
5
 use Illuminate\Support\ServiceProvider;
6
+use Illuminate\Support\Facades\Schema;
6
 
7
 
7
 class AppServiceProvider extends ServiceProvider
8
 class AppServiceProvider extends ServiceProvider
8
 {
9
 {
13
      */
14
      */
14
     public function boot()
15
     public function boot()
15
     {
16
     {
16
-        //
17
+        Schema::defaultStringLength(191);
17
     }
18
     }
18
 
19
 
19
     /**
20
     /**

+ 1
- 1
manage-server/config/database.php 查看文件

51
             'collation' => 'utf8mb4_unicode_ci',
51
             'collation' => 'utf8mb4_unicode_ci',
52
             'prefix' => '',
52
             'prefix' => '',
53
             'strict' => true,
53
             'strict' => true,
54
-            'engine' => null,
54
+            'engine' => 'InnoDB ROW_FORMAT=DYNAMIC',
55
         ],
55
         ],
56
 
56
 
57
         'pgsql' => [
57
         'pgsql' => [

+ 12
- 0
manage-server/routes/web.php 查看文件

14
 Route::get('/', function () {
14
 Route::get('/', function () {
15
     return view('welcome');
15
     return view('welcome');
16
 });
16
 });
17
+
18
+
19
+Route::post('/common/upload', 'CommonController@upload');
20
+Route::post('/campaign/create', 'CampaignController@create');
21
+Route::post('/campaign/update', 'CampaignController@update');
22
+Route::delete('/campaign/delete', 'CampaignController@delete');
23
+Route::get('/campaign/list', 'CampaignController@list');
24
+
25
+Route::post('/product/create', 'ProductController@create');
26
+Route::post('/product/update', 'ProductController@update');
27
+Route::delete('/product/delete', 'ProductController@delete');
28
+Route::get('/product/list', 'ProductController@list');

Loading…
取消
儲存