|
@@ -0,0 +1,45 @@
|
|
|
|
+<?php
|
|
|
|
+
|
|
|
|
+namespace app\admin\controller\sys_manage;
|
|
|
|
+
|
|
|
|
+use app\model\Order;
|
|
|
|
+use support\Request;
|
|
|
|
+
|
|
|
|
+class BellsController
|
|
|
|
+{
|
|
|
|
+ public function orderNum()
|
|
|
|
+ {
|
|
|
|
+ $orderNum = Order::whereJsonContains('order_config_json->bell', 'Y')->count();
|
|
|
|
+
|
|
|
|
+ return json_success('success', ['num' => $orderNum]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function orderList()
|
|
|
|
+ {
|
|
|
|
+ $orders = Order::whereJsonContains('order_config_json->bell', 'Y')
|
|
|
|
+ ->select('order_id', 'order_addtimes', 'order_status_system')
|
|
|
|
+ ->get()
|
|
|
|
+ ->toArray();
|
|
|
|
+
|
|
|
|
+ return json_success('success', ['orders' => $orders]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function closeOrderBell(Request $request)
|
|
|
|
+ {
|
|
|
|
+ $orderId = $request->post('order_id');
|
|
|
|
+ if (!$orderId) {
|
|
|
|
+ return json_fail("参数异常");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $order = Order::where('order_id', $orderId)->first();
|
|
|
|
+ if (!empty($order->order_config_json)) {
|
|
|
|
+ $orderConfigJson = json_decode($order->order_config_json, true);
|
|
|
|
+ unset($orderConfigJson['bell']);
|
|
|
|
+
|
|
|
|
+ $order->order_config_json = json_encode($orderConfigJson);
|
|
|
|
+ $order->save();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return json_success('success');
|
|
|
|
+ }
|
|
|
|
+}
|