shish 11 месяцев назад
Родитель
Сommit
bf5be2fe50
2 измененных файлов с 5 добавлено и 13 удалено
  1. 5 5
      app-hd/controllers/OrderController.php
  2. 0 8
      biz-hd/order/services/OrderService.php

+ 5 - 5
app-hd/controllers/OrderController.php

@@ -1106,11 +1106,11 @@ class OrderController extends BaseController
     public function actionClassify()
     {
         $post = Yii::$app->request->post();
-        $id = isset($post['id']) ? $post['id'] : 0;
+        $id = $post['id'] ?? 0;
         $order = OrderService::getById($id);
         OrderService::valid($order, $this->mainId);
-        $categoryId = isset($post['categoryId']) ? $post['categoryId'] : $post['categoryId'];
-        $usageId = isset($post['usageId']) ? $post['usageId'] : $post['usageId'];
+        $categoryId = $post['categoryId'];
+        $usageId = $post['usageId'];
         OrderService::classify($id, $categoryId, $usageId);
         util::complete();
     }
@@ -1119,7 +1119,7 @@ class OrderController extends BaseController
     public function actionUpdateSheet()
     {
         $post = Yii::$app->request->post();
-        $id = isset($post['id']) ? $post['id'] : 0;
+        $id = $post['id'] ?? 0;
         unset($post['id']);
         $order = OrderService::getById($id);
         OrderService::valid($order, $this->mainId);
@@ -1133,7 +1133,7 @@ class OrderController extends BaseController
         $post = Yii::$app->request->post();
         $price = isset($post['price']) && is_numeric($post['price']) ? $post['price'] : 0;
         $payWay = isset($post['payWay']) && is_numeric($post['payWay']) ? $post['payWay'] : 0;
-        $userId = isset($post['userId']) ? $post['userId'] : 0;
+        $userId = $post['userId'] ?? 0;
         $userInfo = UserService::getById($userId);
         if (empty($userInfo) || $userInfo['sjId'] != $this->sjId) {
             util::fail('您选择的客户无效');

+ 0 - 8
biz-hd/order/services/OrderService.php

@@ -370,7 +370,6 @@ class OrderService extends BaseService
         $sjIdList = array_filter(array_unique($sjIdList));
         $merchantList = MerchantService::getByIds($sjIdList, null, 'id');
 
-        $periodData = [0 => '上午', 1 => '下午', 2 => '晚上'];
         $defaultImg = imgUtil::groupImg('');
         foreach ($data['list'] as $key => $val) {
             $id = $val['id'];
@@ -388,13 +387,6 @@ class OrderService extends BaseService
             $sjId = $val['sjId'];
             $data['list'][$key]['name'] = $merchantList[$sjId]['name'] ?? '';
             $data['list'][$key]['reachTime'] = OrderClass::getReachTime($val);
-            $requireReachTime = '';
-            if ($val['reachDate'] != '0000-00-00') {
-                $reachPeriodId = $val['reachPeriod'];
-                $reachPeriod = $periodData[$reachPeriodId] ?? '上午';
-                $requireReachTime = date("m-d", strtotime($val['reachDate'])) . ' ' . $reachPeriod;
-            }
-            $data['list'][$key]['requireReachTime'] = $requireReachTime;
             $shortCover = $val['cover'] ?? '';
             $data['list'][$key]['cover'] = imgUtil::groupImg($shortCover);