Browse Source

Merge branch 'master' of http://git.huaml.com/zhh/huahuibao

shish 5 năm trước cách đây
mục cha
commit
d4f076211d

+ 2 - 12
app-ghs/controllers/ShopController.php

@@ -59,23 +59,13 @@ class ShopController extends BaseController
     {
         $data = Yii::$app->request->post();
         $data['merchantId'] = $this->sjId;
+        $data['shopId'] = $this->shopId;
+        $data['adminId'] = $this->adminId;
         $data['img'] = is_array($data['img']) ? json_encode($data['img']) : $data['img'];
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
         try {
             $shop = ShopClass::addShop($data);
-            $shopId = $shop['id'];
-            //门店product 同步数据  linqh 2021.4.18
-            $product = ProductClass::getAllProduct($this->sjId, $this->shopId, "name,cover,classId,itemId,rank,price,priceLabel,cost,addPrice,stockWarning,weight,alias,py,ratio,bigUnit,smallUnit,bigUnitId,smallUnitId,inTurn");
-            $productData = [];
-            foreach ($product as $v) {
-                $tmp = $v;
-                $tmp['merchantId'] = $this->sjId;
-                $tmp['shopId'] = $shopId;
-                $tmp['adminId'] = $this->adminId;
-                $productData[] = $tmp;
-            }
-            ProductClass::batchAdd($productData);
             $transaction->commit();
             util::complete();
         } catch (\Exception $exception) {

+ 1 - 1
app-ghs/controllers/WsController.php

@@ -11,7 +11,7 @@ use GatewayClient\Gateway;
 class WsController extends BaseController
 {
 
-    public $guestAccess = ['bind'];
+    public $guestAccess = ['bind','send'];
 
     //绑定用户
     public function actionBind()

+ 3 - 1
app-hd/controllers/ShopController.php

@@ -50,6 +50,8 @@ class ShopController extends BaseController
     {
         $data = Yii::$app->request->post();
         $data['merchantId'] = $this->sjId;
+        $data['shopId'] = $this->shopId;
+        $data['adminId'] = $this->adminId;
         ShopService::addShop($data);
         util::complete();
     }
@@ -184,4 +186,4 @@ class ShopController extends BaseController
         util::success($res);
     }
 
-}
+}

+ 1 - 1
app-hd/controllers/WsController.php

@@ -14,7 +14,7 @@ use GatewayClient\Gateway;
 class WsController extends BaseController
 {
 
-    public $guestAccess = ['bind'];
+    public $guestAccess = ['bind','send'];
 
     //绑定用户
     public function actionBind()

+ 0 - 3
biz-ghs/admin/classes/AdminClass.php

@@ -279,9 +279,6 @@ class AdminClass extends BaseClass
         if (!empty($nickName)) {
             $data['name'] = $nickName;
         }
-        if (isset($original['name']) && !empty($original['name'])) {
-            $data['name'] = $original['name'];
-        }
         if (isset($getAdminInfo['openId']) && !empty($getAdminInfo['openId'])) {
             $openId = $getAdminInfo['openId'];
             $data['openId'] = $openId;

+ 5 - 0
biz-ghs/merchant/classes/ShopClass.php

@@ -62,6 +62,11 @@ class ShopClass extends BaseClass
         //补充fullAddress linqh 2021.4.18
         $data['fullAddress'] = $data['province'].$data['city'].$data['address'].$data['floor'];
         $shop = self::add($data);
+        $newShopId = $shop['id'];
+        //初始化花材 linqh 2021.5.11
+        $adminId = $data['adminId']??0;
+        $shopId = $data['shopId']??0;
+        ProductClass::newShopInitProduct($data['merchantId'],$shopId,$newShopId,$adminId);
         return $shop;
     }
 

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

@@ -725,4 +725,19 @@ class ProductClass extends BaseClass
 
         return $productList;
     }
+
+    //供货商、零售端新开门店时,初始化花材
+    public static function newShopInitProduct($sjId,$shopId,$newShopId,$adminId)
+    {
+        $product = self::getAllProduct($sjId, $shopId, "name,cover,classId,itemId,rank,price,priceLabel,cost,addPrice,stockWarning,weight,alias,py,ratio,bigUnit,smallUnit,bigUnitId,smallUnitId,inTurn");
+        $productData = [];
+        foreach ($product as $v) {
+            $tmp = $v;
+            $tmp['merchantId'] = $sjId;
+            $tmp['shopId'] = $newShopId;
+            $tmp['adminId'] = $adminId;
+            $productData[] = $tmp;
+        }
+        self::batchAdd($productData);
+    }
 }

+ 12 - 0
biz-ghs/shop/classes/ShopAdminClass.php

@@ -100,4 +100,16 @@ class ShopAdminClass extends BaseClass
         return $relation;
     }
 
+    //通过shopId 获取相应的需要通知的 shopAdminIds (status=1 and delStatus=0 and remind=1)
+    public static function getRemindAdminIdsByShopId($shopId)
+    {
+        $where = [
+            'shopId'=>$shopId,
+            'status'=>1,
+            'delStatus'=>0,
+            'remind'=>1
+        ];
+        $data = self::getAllByCondition($where,null,"id");
+        return array_column($data,'id');
+    }
 }

+ 7 - 1
biz-hd/merchant/classes/ShopClass.php

@@ -2,6 +2,7 @@
 
 namespace bizHd\merchant\classes;
 
+use bizGhs\product\classes\ProductClass;
 use bizHd\admin\classes\ShopAdminClass;
 use common\components\dirUtil;
 use common\components\httpUtil;
@@ -42,6 +43,11 @@ class ShopClass extends BaseClass
         }
         $data['img'] = isset($data['img']) ? json_encode($data['img']) : json_encode([]);
         $shop = self::add($data);
+        $newShopId = $shop['id'];
+        //初始化花材 linqh 2021.5.11
+        $adminId = $data['adminId']??0;
+        $shopId = $data['shopId']??0;
+        ProductClass::newShopInitProduct($data['merchantId'],$shopId,$newShopId,$adminId);
         return $shop;
     }
 
@@ -106,4 +112,4 @@ class ShopClass extends BaseClass
         $shop->save();
     }
 
-}
+}

+ 7 - 0
biz-hd/order/classes/OrderClass.php

@@ -8,6 +8,7 @@ use biz\shop\classes\ShopAdminClass;
 use biz\shop\models\Shop;
 use biz\stat\classes\StatOrderCountClass;
 use bizGhs\stat\classes\StatYjClass;
+use bizGhs\ws\services\WsService;
 use bizHd\user\classes\UserClass;
 use common\components\miniUtil;
 use common\components\orderSn;
@@ -158,6 +159,12 @@ class OrderClass extends BaseClass
         }
         $date = date("Y-m-d H:i:s");
         $order->payTime = $date;
+        $shopAdminIds = \bizGhs\shop\classes\ShopAdminClass::getRemindAdminIdsByShopId($order->shopId);
+        if($shopAdminIds){
+            foreach ($shopAdminIds as $v){
+                WsService::arrivalNotice($v,$order->actPrice);
+            }
+        }
         self::complete($order, $payWay);
     }
 

+ 17 - 1
sql.sql

@@ -32,6 +32,19 @@ wxOpen 平台和公众号 小程序要补好
 要和供货商确认 要初始化的东西 花材的重量 花材的比例 成本价 加价 大小单位
 
 
+=============================================================================
+
+
+nginx配置修改
+nginx.conf
+```
+http {
+ 
+    client_max_body_size 50m; # 配置nginx上传文件最大限制,默认1m
+}
+```
+
+
 =============================================================================
 
 CREATE TABLE xhItem(
@@ -2440,4 +2453,7 @@ ALTER TABLE xhCustom MODIFY id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '
 TRUNCATE xhUser;
 TRUNCATE xhCustom;
 ALTER TABLE xhUser AUTO_INCREMENT=958260;
-ALTER TABLE xhCustom AUTO_INCREMENT=980361;
+ALTER TABLE xhCustom AUTO_INCREMENT=980361;
+
+ws nginx配置 需要分别配置供货商,零售端 ,商城的域名
+ws 定时监控脚本