Эх сурвалжийг харах

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

shish 5 жил өмнө
parent
commit
92597ba4c1

+ 4 - 1
app-ghs/controllers/AuthController.php

@@ -161,6 +161,9 @@ class AuthController extends PublicController
         }
         $adminId = $admin['id'];
         $shopAdmin = ShopAdminService::getByCondition(['adminId' => $adminId, 'delStatus' => 0]);
+        if($shopAdmin['status']==0){
+            util::fail("您的账号还未激活");
+        }
         $merchantId = isset($shopAdmin['merchantId']) ? $shopAdmin['merchantId'] : 0;
         $shopId = $shopAdmin['shopId'] ?? 0;
         if (empty($shopId)) {
@@ -231,4 +234,4 @@ class AuthController extends PublicController
         ]);
     }
 
-}
+}

+ 10 - 0
app-ghs/controllers/PurchaseOrderController.php

@@ -1,6 +1,7 @@
 <?php
 namespace ghs\controllers;
 
+use biz\ghs\classes\GhsClass;
 use bizGhs\order\classes\PurchaseOrderClass;
 use bizGhs\order\classes\PurchaseOrderItemClass;
 use bizGhs\order\models\PurchaseOrder;
@@ -30,6 +31,15 @@ class PurchaseOrderController extends BaseController
 
         //判断花材格式,是否属于当前门店
         ProductClass::valid($ghsItemInfo,$this->shopId);
+        //获取供应商信息
+        $supplierId = $post['supplierId'];
+        $supplierId = 125884;
+        if(empty($supplierId)){
+            util::fail("请选择供应商");
+        }
+        $supplierInfo = GhsClass::getGhsInfo($supplierId);
+        GhsClass::valid($supplierInfo,$this->shopId);
+        $post['supplierInfo']= json_encode($supplierInfo);
 
         //判断花材里的信息
         foreach ($ghsItemInfo as $v){

+ 1 - 0
biz-ghs/order/classes/PurchaseOrderClass.php

@@ -170,6 +170,7 @@ class PurchaseOrderClass extends BaseClass
             'shopId'=>$shopId,
         ];
         $orderData = self::getByCondition($where);
+        $orderData['supplierInfo'] = json_decode($orderData['supplierInfo']);
         if(!$orderData) {
             util::fail('订单不存在');
         }

+ 7 - 1
biz/ghs/classes/GhsClass.php

@@ -117,6 +117,9 @@ class GhsClass extends BaseClass
     public static function getGhsInfo($id)
     {
         $info = self::getById($id);
+        if(empty($info)){
+            return [];
+        }
         $list = self::groupBaseInfo([$info]);
         return current($list);
     }
@@ -139,10 +142,13 @@ class GhsClass extends BaseClass
     //验证权限 shish 2021.4.11
     public static function valid($info, $shopId)
     {
+        if(empty($info)){
+            util::fail('供应商不存在');
+        }
         if ($info['shopId'] == $shopId) {
             return true;
         }
-        util::fail('您没有权限访问的供商');
+        util::fail('您没有权限访问的供商');
     }
 
 }

+ 7 - 0
sql.sql

@@ -2206,3 +2206,10 @@ ALTER TABLE xhGoods MODIFY `py` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '拼音'
 ALTER TABLE xhGoodsCategory ADD py VARCHAR(50) NOT NULL DEFAULT '' COMMENT '拼音' AFTER `goodsName`;
 
 执行命令将原有的商品拼音补齐 yii goods/py
+
+
+===============linqh  2021-04-25
+=====
+ALTER TABLE `xhGhsPurchaseOrder`
+ADD COLUMN `supplierInfo`  varchar(500) NOT NULL DEFAULT '' COMMENT '供应商信息' AFTER `supplierId`;
+