shish 2 месяцев назад
Родитель
Сommit
9a9e753fb1

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

@@ -723,6 +723,47 @@ class ItemController extends BaseController
         util::complete();
     }
 
+
+    //花材展示备注 ssh 20260527
+    public function actionUpdateItemRemark()
+    {
+        $get = Yii::$app->request->get();
+        $id = $get['id'] ?? 0;
+        $itemRemark = trim($get['itemRemark'] ?? '');
+        if (empty($itemRemark)) {
+            util::fail('请填写备注');
+        }
+        if (mb_strlen($itemRemark) > 200) {
+            util::fail('备注不能超过200字');
+        }
+        $info = ItemClass::getById($id, true);
+        if (empty($info)) {
+            util::fail('没有找到花材');
+        }
+        if ($info->mainId != $this->mainId) {
+            util::fail('无法操作');
+        }
+        $info->itemRemark = $itemRemark;
+        $info->save();
+        util::complete('保存成功');
+    }
+
+    public function actionClearItemRemark()
+    {
+        $get = Yii::$app->request->get();
+        $id = $get['id'] ?? 0;
+        $info = ItemClass::getById($id, true);
+        if (empty($info)) {
+            util::fail('没有找到花材');
+        }
+        if ($info->mainId != $this->mainId) {
+            util::fail('无法操作');
+        }
+        $info->itemRemark = '';
+        $info->save();
+        util::complete('清除成功');
+    }
+
     //批量隐藏和显示花材 ssh 20260131
     public function actionBatchChangeFrontHide()
     {

+ 1 - 0
app-ghs/controllers/PurchaseOrderItemController.php

@@ -134,6 +134,7 @@ class PurchaseOrderItemController extends BaseController
                 $beforeModifyStock = $current['stock'] ?? 0;
                 $list[$key]['beforeModifyStock'] = $beforeModifyStock;
                 $list[$key]['limitBuy'] = intval($current['limitBuy'] ?? 0);
+                $list[$key]['itemRemark'] = $current['itemRemark'] ?? '';
             }
         }
         util::success(['list' => $list]);

+ 2 - 2
app-hd/controllers/ProductController.php

@@ -693,7 +693,7 @@ class ProductController extends BaseController
             $where['frontHide'] = 0;
 
             $level = $ghs['giveLevel'] ?? 1;
-            $field = 'id,py,cover,name,ratio,classId,itemId,weight,smallUnit,bigUnit,smallUnit,smallRatio,ratioType,variety,price,skPrice,skDiscountPrice,hjPrice,hjDiscountPrice,actualSold,stock,stockWarning,discountPrice,presell,presellDate,reachNum,reachNumDiscount,limitBuy';
+            $field = 'id,py,cover,name,ratio,classId,itemId,weight,smallUnit,bigUnit,smallUnit,smallRatio,ratioType,variety,price,skPrice,skDiscountPrice,hjPrice,hjDiscountPrice,actualSold,stock,stockWarning,discountPrice,presell,presellDate,reachNum,reachNumDiscount,limitBuy,itemRemark';
             $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
             $itemInfoData = ProductClass::hdCgGroup($itemInfoData, $level, $ghs);
             $myProduct = ProductClass::getAllByCondition(['mainId' => $this->mainId, 'delStatus' => 0], null, 'id,stock,onStock,stockWarning,itemId', 'itemId');
@@ -782,7 +782,7 @@ class ProductController extends BaseController
             $where['frontHide'] = 0;
 
             $level = $ghs['giveLevel'] ?? 1;
-            $field = 'id,py,cover,name,ratio,classId,itemId,weight,smallUnit,bigUnit,smallUnit,smallRatio,ratioType,variety,price,skPrice,skDiscountPrice,hjPrice,hjDiscountPrice,avCost,actualSold,stock,stockWarning,discountPrice,presell,presellDate,reachNum,reachNumDiscount,limitBuy';
+            $field = 'id,py,cover,name,ratio,classId,itemId,weight,smallUnit,bigUnit,smallUnit,smallRatio,ratioType,variety,price,skPrice,skDiscountPrice,hjPrice,hjDiscountPrice,avCost,actualSold,stock,stockWarning,discountPrice,presell,presellDate,reachNum,reachNumDiscount,limitBuy,itemRemark';
             $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
             $itemInfoData = ProductClass::hdCgGroup($itemInfoData, $level, $ghs);
             $myProduct = ProductClass::getAllByCondition(['mainId' => $this->mainId, 'delStatus' => 0], null, 'id,stock,onStock,stockWarning,itemId', 'itemId');

+ 1 - 0
biz-ghs/product/classes/ProductClass.php

@@ -1276,6 +1276,7 @@ class ProductClass extends BaseClass
                     $addData['stockWarning'] = $oldProductInfo[$v]['stockWarning'] ?? 5;
                     $addData['weight'] = $oldProductInfo[$v]['weight'] ?? 0;
                     $addData['alias'] = $oldProductInfo[$v]['alias'] ?? '';
+                    $addData['itemRemark'] = $oldProductInfo[$v]['itemRemark'] ?? '';
                     $addData['py'] = $oldProductInfo[$v]['py'] ?? '';
                     $addData['ratio'] = $oldProductInfo[$v]['ratio'] ?? 20;
                     $addData['bigUnit'] = $oldProductInfo[$v]['bigUnit'] ?? '';