yingzi 2 rokov pred
rodič
commit
702c5e1e77
1 zmenil súbory, kde vykonal 6 pridanie a 1 odobranie
  1. 6 1
      Model/Purchase/MPurchase.Class.php

+ 6 - 1
Model/Purchase/MPurchase.Class.php

@@ -746,7 +746,7 @@ class MPurchase extends MBaseModel
             $groupBySql = ' GROUP BY p.supplierId,g.basicGoodsId';
         } elseif ($type == 3) {//采购人员
             $groupBySql = ' GROUP BY p.buyerId,g.basicGoodsId';
-        } elseif($type==4){
+        } elseif($type  == 4){
             $groupBySql = ' GROUP BY p.shopId,g.basicGoodsId';
         }else {
             return ResultWrapper::fail('type参数错误', ErrorCode::$paramError);
@@ -781,6 +781,11 @@ class MPurchase extends MBaseModel
             $where = empty($whereSql) ? ' WHERE ' : ' AND ';
             $whereSql .= $where . ' p.buyerId = ' . $selectParams['buyerId'];
         }
+        if (isset($selectParams['shopId']) && !empty($selectParams['shopId'])) {
+            $where = empty($whereSql) ? ' WHERE ' : ' AND ';
+            $whereSql .= $where . ' p.shopId = ' . $selectParams['shopId'];
+        }
+        
 
         //统计已审核 未删除主单据 未删除详情 的采购订单
         $where = empty($whereSql) ? ' WHERE ' : ' AND ';