shish 3 лет назад
Родитель
Сommit
0a75298964
1 измененных файлов с 22 добавлено и 0 удалено
  1. 22 0
      app-ghs/controllers/CustomController.php

+ 22 - 0
app-ghs/controllers/CustomController.php

@@ -23,6 +23,28 @@ use Yii;
 class CustomController extends BaseController
 {
 
+    //修改散客身份 ssh 20230216
+    public function actionChangePerson()
+    {
+        $get = Yii::$app->request->get();
+        $id = $get['id'] ?? 0;
+        $person = $get['person'] ?? 0;
+        $custom = CustomClass::getById($id, true);
+        if (empty($custom) || $custom->ownMainId != $this->mainId) {
+            util::fail('修改失败');
+        }
+        $ghsId = $custom->ghsId ?? 0;
+        $ghs = GhsClass::getById($ghsId, true);
+        if (empty($ghs)) {
+            util::fail('修改失败');
+        }
+        $ghs->person = $person;
+        $ghs->save();
+        $custom->person = $person;
+        $custom->save();
+        util::complete('修改成功');
+    }
+
     //修改物流名称 ssh 20230112
     public function actionChangeWlName()
     {