|
|
@@ -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()
|
|
|
{
|