Bläddra i källkod

修改散客身份

shish 3 år sedan
förälder
incheckning
0a75298964
1 ändrade filer med 22 tillägg och 0 borttagningar
  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
 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
     //修改物流名称 ssh 20230112
     public function actionChangeWlName()
     public function actionChangeWlName()
     {
     {