Forráskód Böngészése

Merge branch 'itemremark'

shish 2 hónapja
szülő
commit
5ec006414b

+ 26 - 0
.aiignore

@@ -0,0 +1,26 @@
+# Dependencies & vendors
+node_modules/
+vendor/
+
+# Build & generated output
+dist/
+build/
+**/web/assets/
+coverage/
+
+# Runtime & logs
+runtime/
+console/runtime/
+logs/
+*.log
+
+# VCS & IDE
+.git/
+.idea/
+.hbuilderx/
+.DS_Store
+
+# Secrets
+
+# Source maps
+*.map

+ 27 - 0
.cursorignore

@@ -0,0 +1,27 @@
+# Dependencies & vendors
+node_modules/
+vendor/
+
+# Build & generated output
+dist/
+build/
+**/web/assets/
+coverage/
+
+# Runtime & logs
+runtime/
+console/runtime/
+logs/
+*.log
+
+# VCS & IDE
+.git/
+.idea/
+.hbuilderx/
+.DS_Store
+
+# Secrets
+
+
+# Source maps
+*.map

+ 27 - 0
.windsurfignore

@@ -0,0 +1,27 @@
+# Dependencies & vendors
+node_modules/
+vendor/
+
+# Build & generated output
+dist/
+build/
+**/web/assets/
+coverage/
+
+# Runtime & logs
+runtime/
+console/runtime/
+logs/
+*.log
+
+# VCS & IDE
+.git/
+.idea/
+.hbuilderx/
+.DS_Store
+
+# Secrets
+
+
+# Source maps
+*.map

+ 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 - 0
app-ghs/controllers/ShopMoneyController.php

@@ -35,6 +35,7 @@ class ShopMoneyController extends BaseController
             $data['amount'] = $amount;
             $data['staffId'] = $staffId;
             $data['staffName'] = $staff->name ?? '';
+            $data['remark'] = trim($get['remark'] ?? '');
             $data['ptStyle'] = dict::getDict('ptStyle', 'ghs');
             $main = MainClass::getLockById($mainId);
             if (empty($main)) {
@@ -73,6 +74,7 @@ class ShopMoneyController extends BaseController
             $data['amount'] = $amount;
             $data['staffId'] = $staffId;
             $data['staffName'] = $staff->name ?? '';
+            $data['remark'] = trim($get['remark'] ?? '');
             $data['ptStyle'] = dict::getDict('ptStyle', 'ghs');
             $main = MainClass::getLockById($mainId);
             if (empty($main)) {

+ 40 - 0
app-hd/controllers/ItemController.php

@@ -505,4 +505,44 @@ class ItemController extends BaseController
         $customList = ProductClass::getHasLimitBuyList($item);
         util::success(['customList' => $customList]);
     }
+
+    //花材展示备注
+    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('清除成功');
+    }
 }

+ 2 - 1
app-hd/controllers/MainController.php

@@ -292,7 +292,8 @@ class MainController extends BaseController
         if (isset($shop->avatar) && !empty($shop->avatar)) {
             $shopImg = Yii::$app->params['ghsImgHost'] . $shop->avatar;
         }
-        $deadline = $sj['deadline'] ?? '';
+        // 到期时间取当前门店 xhShop.deadline(续费、业务校验均以此为准)
+        $deadline = $shop->deadline ?? '';
         $relation = isset($this->shopAdmin) && !empty($this->shopAdmin) ? $this->shopAdmin->attributes : [];
         $adminName = $relation['name'] ?? '';
         $eId = $relation['id'] ?? 0;

+ 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');

+ 3 - 2
app-hd/controllers/RechargeController.php

@@ -448,8 +448,9 @@ class RechargeController extends BaseController
     //续期成功 ssh 2021.2.21
     public function actionRenewSuccess()
     {
-        $sj = $this->sj->attributes;
-        $deadline = date("Y-m-d H:i", strtotime($sj['deadline']));
+        $shop = $this->shop;
+        $deadline = $shop->deadline ?? '';
+        $deadline = date("Y-m-d H:i", strtotime($deadline));
         util::success(['deadline' => $deadline]);
     }
 

+ 2 - 0
app-hd/controllers/ShopMoneyController.php

@@ -43,6 +43,7 @@ class ShopMoneyController extends BaseController
             $data['amount'] = $amount;
             $data['staffId'] = $staffId;
             $data['staffName'] = $staff->name ?? '';
+            $data['remark'] = trim($get['remark'] ?? '');
             $data['ptStyle'] = dict::getDict('ptStyle', 'hd');
             $main = MainClass::getLockById($mainId);
             if (empty($main)) {
@@ -79,6 +80,7 @@ class ShopMoneyController extends BaseController
             $data['amount'] = $amount;
             $data['staffId'] = $staffId;
             $data['staffName'] = $staff->name ?? '';
+            $data['remark'] = trim($get['remark'] ?? '');
             $data['ptStyle'] = dict::getDict('ptStyle', 'hd');
             $main = MainClass::getLockById($mainId);
             if (empty($main)) {

+ 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'] ?? '';

+ 4 - 0
biz-hd/shop/classes/ShopMoneyClass.php

@@ -25,6 +25,7 @@ class ShopMoneyClass extends BaseClass
         $return = self::addData($data);
         $id = $return->id ?? 0;
         $staffName = $data['staffName'] ?? '';
+        $remark = trim($data['remark'] ?? '');
         $event = $staffName . '存入' . $amount . '元';
         $capitalType = dict::getDict('capitalType', 'inMoney', 'id');
         if (isset($data['ptStyle'])) {
@@ -42,6 +43,7 @@ class ShopMoneyClass extends BaseClass
             'capitalType' => $capitalType,
             'ptStyle' => $ptStyle,
             'event' => $event,
+            'remark' => $remark,
         ];
         ShopMoneyChangeClass::addData($change);
     }
@@ -63,6 +65,7 @@ class ShopMoneyClass extends BaseClass
         $return = self::addData($data);
         $id = $return->id ?? 0;
         $staffName = $data['staffName'] ?? '';
+        $remark = trim($data['remark'] ?? '');
         $event = $staffName . '取出' . $amount . '元';
         $capitalType = dict::getDict('capitalType', 'outMoney', 'id');
         if (isset($data['ptStyle'])) {
@@ -79,6 +82,7 @@ class ShopMoneyClass extends BaseClass
             'capitalType' => $capitalType,
             'ptStyle' => $ptStyle,
             'event' => $event,
+            'remark' => $remark,
         ];
         ShopMoneyChangeClass::addData($change);
     }