Просмотр исходного кода

添加商家备注remark,添加列表搜索条件keyword

chenxiqiang 7 лет назад
Родитель
Сommit
2587ecc41a

+ 14
- 1
manage-server/app/Http/Controllers/MaternityMatronOrderController.php Просмотреть файл

38
         $phone = $request->input('phone');
38
         $phone = $request->input('phone');
39
         $status = $request->input('status');
39
         $status = $request->input('status');
40
         $price = $request->input('price');
40
         $price = $request->input('price');
41
+        $remark = $request->input('remark');
41
         if ($id) {
42
         if ($id) {
42
             $maternityMatronOrder = MaternityMatronOrder::find($id);
43
             $maternityMatronOrder = MaternityMatronOrder::find($id);
43
             $maternityMatronOrder->status = $status;
44
             $maternityMatronOrder->status = $status;
56
             $maternityMatronOrder->level = $level;
57
             $maternityMatronOrder->level = $level;
57
             $maternityMatronOrder->expected_date = $expected_date;
58
             $maternityMatronOrder->expected_date = $expected_date;
58
             $maternityMatronOrder->special_demand = $special_demand;
59
             $maternityMatronOrder->special_demand = $special_demand;
60
+            $maternityMatronOrder->remark = $remark;
59
             $maternityMatronOrder->server_time = $server_time;
61
             $maternityMatronOrder->server_time = $server_time;
60
             $maternityMatronOrder->address = $address;
62
             $maternityMatronOrder->address = $address;
61
             $maternityMatronOrder->contact = $contact;
63
             $maternityMatronOrder->contact = $contact;
83
      */
85
      */
84
     public function list(Request $request)
86
     public function list(Request $request)
85
     {
87
     {
86
-        return MaternityMatronOrder::paginate(20);
88
+        $keyword = $request->input('keyword');
89
+        if($keyword) {
90
+            $data = MaternityMatronOrder::where("special_demand", $keyword)
91
+                ->orWhere("contact", $keyword)
92
+                ->orWhere("phone", $keyword)
93
+                ->orWhere("remark", $keyword)
94
+                ->paginate();
95
+        } else {
96
+            $data = MaternityMatronOrder::paginate();
97
+        }
98
+        $data->appends(["keyword" => $keyword]);
99
+        return $data;
87
     }
100
     }
88
 }
101
 }

+ 19
- 4
manage-server/app/Http/Controllers/OptionOrderController.php Просмотреть файл

34
         $classify = $request->input('type');
34
         $classify = $request->input('type');
35
         $price = $request->input('price');
35
         $price = $request->input('price');
36
         $status = $request->input('status');
36
         $status = $request->input('status');
37
+        $remark = $request->input('remark');
37
 
38
 
38
         if($options && $address && $contact && $phone && $classify) {
39
         if($options && $address && $contact && $phone && $classify) {
39
             if(!$id) {
40
             if(!$id) {
49
             $option_order->contact = $contact;
50
             $option_order->contact = $contact;
50
             $option_order->phone = $phone;
51
             $option_order->phone = $phone;
51
             $option_order->notes = $notes;
52
             $option_order->notes = $notes;
53
+            $option_order->remark = $remark;
52
             $option_order->classify = $classify;
54
             $option_order->classify = $classify;
53
             $option_order->options = json_encode($options, JSON_UNESCAPED_UNICODE);
55
             $option_order->options = json_encode($options, JSON_UNESCAPED_UNICODE);
54
             if($classify) {
56
             if($classify) {
76
     }
78
     }
77
 
79
 
78
 
80
 
81
+    /**
82
+     * 每页20进行分页
83
+     * @param Request $request
84
+     * @return mixed
85
+     */
79
     /**
86
     /**
80
      * 每页20进行分页
87
      * 每页20进行分页
81
      * @param Request $request
88
      * @param Request $request
83
      */
90
      */
84
     public function list(Request $request)
91
     public function list(Request $request)
85
     {
92
     {
86
-        $classify = $request->input("classify");
87
-        if($classify) {
88
-            return OptionOrder::where("classify", $classify)->paginate(20);
93
+        $keyword = $request->input('keyword');
94
+        if($keyword) {
95
+            $data = MaternityMatronOrder::where("notes", $keyword)
96
+                ->orWhere("contact", $keyword)
97
+                ->orWhere("classify", $keyword)
98
+                ->orWhere("phone", $keyword)
99
+                ->orWhere("remark", $keyword)
100
+                ->paginate();
101
+        } else {
102
+            $data = MaternityMatronOrder::paginate();
89
         }
103
         }
90
-        return OptionOrder::paginate(20);
104
+        $data->appends(["keyword" => $keyword]);
105
+        return $data;
91
     }
106
     }
92
 }
107
 }

+ 15
- 2
manage-server/app/Http/Controllers/ProductOrderController.php Просмотреть файл

60
             $productOrder->address = $address;
60
             $productOrder->address = $address;
61
             $productOrder->contact = $contact;
61
             $productOrder->contact = $contact;
62
             $productOrder->phone = $phone;
62
             $productOrder->phone = $phone;
63
-            $productOrder->photo = "https://wechat.sotype.com/storage/gOtuHM3GvKva6x68N340DJuN6cX1oIfaAhWi8yoq.jpeg";
63
+            $productOrder->photo = $photo;//"https://wechat.sotype.com/storage/gOtuHM3GvKva6x68N340DJuN6cX1oIfaAhWi8yoq.jpeg";
64
             $productOrder->wechat_id = $wechat_id;
64
             $productOrder->wechat_id = $wechat_id;
65
             $productOrder->save();
65
             $productOrder->save();
66
             return Response()->json([
66
             return Response()->json([
83
      */
83
      */
84
     public function list(Request $request)
84
     public function list(Request $request)
85
     {
85
     {
86
-        return ProductOrder::paginate(20);
86
+        $keyword = $request->input('keyword');
87
+        if($keyword) {
88
+            $data = ProductOrder::where("product_name", $keyword)
89
+                ->orWhere("contact", $keyword)
90
+                ->orWhere("remark", $keyword)
91
+                ->orWhere("info", $keyword)
92
+                ->orWhere("phone", $keyword)
93
+                ->paginate();
94
+        } else {
95
+            $data = ProductOrder::paginate();
96
+        }
97
+        $data->appends(["keyword" => $keyword]);
98
+        return $data;
87
     }
99
     }
100
+
88
 }
101
 }

+ 1
- 0
manage-server/app/Models/MaternityMatronOrder.php Просмотреть файл

18
             'expected_date', // 预产期
18
             'expected_date', // 预产期
19
             'server_time', // 服务时间
19
             'server_time', // 服务时间
20
             'special_demand', // 特殊需求
20
             'special_demand', // 特殊需求
21
+            'remark', // 商家备注
21
         ];
22
         ];
22
         parent::mergeFillable(parent::getFillable(), $fillable);
23
         parent::mergeFillable(parent::getFillable(), $fillable);
23
     }
24
     }

+ 1
- 0
manage-server/app/Models/OptionOrder.php Просмотреть файл

10
         parent::__construct("option_order");
10
         parent::__construct("option_order");
11
         $fillable = [
11
         $fillable = [
12
             'options',
12
             'options',
13
+            'remark', // 商家备注
13
         ];
14
         ];
14
         parent::mergeFillable(parent::getFillable(), $fillable);
15
         parent::mergeFillable(parent::getFillable(), $fillable);
15
     }
16
     }

+ 1
- 0
manage-server/database/migrations/2018_08_10_075128_create_maternity_matron_orders_table.php Просмотреть файл

33
             $table->string('expected_date');
33
             $table->string('expected_date');
34
             $table->string('server_time');
34
             $table->string('server_time');
35
             $table->string('special_demand');
35
             $table->string('special_demand');
36
+            $table->string('remark');
36
             $table->string('contact');
37
             $table->string('contact');
37
             $table->string('address');
38
             $table->string('address');
38
             $table->string('phone');
39
             $table->string('phone');

+ 1
- 0
manage-server/database/migrations/2018_09_23_094814_create_option_orders_table.php Просмотреть файл

25
             $table->double('price');
25
             $table->double('price');
26
             $table->string('photo');
26
             $table->string('photo');
27
             $table->string('notes');
27
             $table->string('notes');
28
+            $table->string('remark');
28
             $table->unsignedInteger('classify');
29
             $table->unsignedInteger('classify');
29
             $table->string('classify1');
30
             $table->string('classify1');
30
             $table->string('classify2');
31
             $table->string('classify2');

Загрузка…
Отмена
Сохранить