فهرست منبع

只要手动添加的都标记为花店,任何情况都不会标记为散客,任何情况都是审核通过的状态

shish 1 سال پیش
والد
کامیت
9830d86a9d
1فایلهای تغییر یافته به همراه13 افزوده شده و 2 حذف شده
  1. 13 2
      console/controllers/CustomController.php

+ 13 - 2
console/controllers/CustomController.php

@@ -196,8 +196,19 @@ class CustomController extends Controller
                 Yii::$app->params['ptStyle'] = 2;
                 ApplyService::pass($id, '批发商手动添加');
                 $transaction->commit();
-                //只要手动添加的都标记为花店,任何情况都不会标记为散客
-                CustomClass::updateByCondition(['mobile' => $mobile], ['isHd' => 1]);
+
+                //只要手动添加的都标记为花店,任何情况都不会标记为散客,任何情况都是审核通过的状态
+                $customList = CustomClass::getAllByCondition(['mobile' => $mobile], null, '*', null, true);
+                if (!empty($customList)) {
+                    foreach ($customList as $custom) {
+                        $custom->isHd = 1;
+                        $custom->passStatus = 1;
+                        $custom->save();
+                        $ghsId = $custom->ghsId;
+                        GhsClass::updateById($ghsId, ['passStatus' => 1]);
+                    }
+                }
+
                 //noticeUtil::push("花店 {$shopName} 手机号 {$mobile} 由批发商添加成功");
             } catch (\Exception $exception) {
                 $transaction->rollBack();