Selaa lähdekoodia

采购人管理

shish 2 vuotta sitten
vanhempi
commit
eb3b751515
1 muutettua tiedostoa jossa 23 lisäystä ja 0 poistoa
  1. 23 0
      app-ghs/controllers/ItemController.php

+ 23 - 0
app-ghs/controllers/ItemController.php

@@ -21,6 +21,29 @@ use Yii;
 class ItemController extends BaseController
 {
 
+    //修改一个花材的采购人 ssh 20240719
+    public function actionModifyCgStaff()
+    {
+        $get = Yii::$app->request->get();
+        $id = $get['id'] ?? 0;
+        $staffId = $get['staffId'] ?? 0;
+        $item = ItemClass::getById($id, true);
+        if (empty($item)) {
+            util::fail('没有找到花材');
+        }
+        if ($item->mainId != $this->mainId) {
+            util::fail('不是你的花材');
+        }
+        $staff = ShopAdminClass::getById($staffId, true);
+        if (empty($staff) || $staff->mainId != $this->mainId) {
+            util::fail('不是你的员工');
+        }
+        $item->cgStaffId = $staffId;
+        $item->cgStaffName = $staff->name ?? '';
+        $item->save();
+        util::complete('修改成功');
+    }
+
     //获取花材最新信息,库存 ssh 20240318
     public function actionGetNewInfo()
     {