林琦海 %!s(int64=5) %!d(string=hai) anos
pai
achega
bae8a7c17b
Modificáronse 2 ficheiros con 23 adicións e 3 borrados
  1. 18 2
      app-ghs/controllers/ProductController.php
  2. 5 1
      sql.sql

+ 18 - 2
app-ghs/controllers/ProductController.php

@@ -93,8 +93,14 @@ class ProductController extends BaseController
         $where['shopId'] = $shopId;
 
         $type = Yii::$app->request->get('type', '');
+        $showPage = Yii::$app->request->get('showPage',0);
+        if($showPage){
+            $res = ProductClass::getList("*",$where);
+            $data = $res['list'];
+        }else{
+            $data = ProductClass::getAllByCondition($where,null,"*");
+        }
 
-        $data = ProductClass::getAllByCondition($where,null,"*");
         $data = ProductClass::groupProductInfo($data);
         if ($type == 'waring') {
             //库存预警
@@ -106,9 +112,19 @@ class ProductController extends BaseController
             }
             util::success(['list' => $newData]);
         }
-        util::success(['list' => $data]);
+        if($showPage){
+            $res['list'] = $data;
+            util::success(['list' => $res]);
+        }else{
+            util::success(['list' => $data]);
+        }
+
+
+
     }
 
+
+
     //改价
     public function actionChangePrice()
     {

+ 5 - 1
sql.sql

@@ -2067,4 +2067,8 @@ ADD COLUMN `smallUnitId`  smallint(6) NOT NULL DEFAULT 2 COMMENT '小单位ID' A
 
 ====shish 2021-4-11
 ALTER TABLE `xhPurchase` ADD deadline DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '有效期' AFTER `debt`;
-ALTER TABLE xhPurchase ADD changePrice TINYINT NOT NULL DEFAULT 1 COMMENT '1可以修改价格 2不能修改' AFTER `orderSn`;
+ALTER TABLE xhPurchase ADD changePrice TINYINT NOT NULL DEFAULT 1 COMMENT '1可以修改价格 2不能修改' AFTER `orderSn`;
+
+========linqh 2021.4.12
+ALTER TABLE `xhGhsProduct`
+ADD COLUMN `inTurn`  int(10) NOT NULL DEFAULT 100 COMMENT '排序' AFTER `smallUnitId`;