Kaynağa Gözat

检查更新

shish 4 yıl önce
ebeveyn
işleme
90bf29f6ff

+ 14 - 0
app-ghs/controllers/ProductController.php

@@ -15,6 +15,7 @@ use bizGhs\merchant\classes\ShopClass;
 use bizGhs\product\classes\ProductClass;
 use bizGhs\product\models\Product;
 use bizGhs\product\services\ProductService;
+use bizGhs\shop\classes\ShopAdminClass;
 use common\components\printUtil;
 use common\components\stringUtil;
 use common\components\util;
@@ -295,6 +296,19 @@ class ProductController extends BaseController
                     }
                 }
             }
+
+            $mainId = $shop->mainId ?? 0;
+            if (!empty($mainId)) {
+                //提醒零售收银台界面要刷新
+                $staffList = ShopAdminClass::getAllByCondition(['mainId' => $mainId], null, '*', null, true);
+                if (!empty($staffList)) {
+                    foreach ($staffList as $staff) {
+                        $staffId = $staff->id ?? 0;
+                        Yii::$app->redis->executeCommand('SET', ['cashier_' . $mainId . '_' . $staffId . '_may_refresh', 'yes']);
+                    }
+                }
+            }
+
             $transaction->commit();
             util::complete('修改成功');
 

+ 22 - 1
app-hd/controllers/ItemController.php

@@ -13,10 +13,31 @@ use Yii;
 class ItemController extends BaseController
 {
 
+    //检测是否要刷新
+    public function actionCheckRefresh()
+    {
+        $mainId = $this->mainId;
+        $staffId = $this->shopAdminId;
+        $respond = Yii::$app->redis->executeCommand('GET', ['cashier_' . $mainId . '_' . $staffId . '_may_refresh']);
+        if ($respond == 'yes') {
+            util::success(['remind' => 1]);
+        }
+        util::complete();
+    }
+
     //列出所有花材,包括特价花材列表 ssh 20220315
     public function actionShowList()
     {
-        $where['mainId'] = $this->mainId;
+        $get = Yii::$app->request->get();
+        $isCashier = $get['isCashier'] ?? 0;
+        $mainId = $this->mainId;
+        if ($isCashier == 1) {
+            //去掉收银台提示价格更新
+            $staffId = $this->shopAdminId;
+            Yii::$app->redis->executeCommand('DEL', ['cashier_' . $mainId . '_' . $staffId . '_may_refresh']);
+        }
+
+        $where['mainId'] = $mainId;
         $where['delStatus'] = 0;
 
         $list = \bizHd\item\classes\ItemClass::getShowList($where);