Sfoglia il codice sorgente

只显示库存大于0的花材

shish 4 anni fa
parent
commit
08eeb98f65
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      app-ghs/controllers/ProductController.php

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

@@ -28,6 +28,7 @@ class ProductController extends BaseController
     public function actionIndex()
     public function actionIndex()
     {
     {
         $py = Yii::$app->request->get('py', '');
         $py = Yii::$app->request->get('py', '');
+        $requestType = Yii::$app->request->get('requestType', 'common');
         //默认显示上架商品
         //默认显示上架商品
         $status = Yii::$app->request->get('status', 1);
         $status = Yii::$app->request->get('status', 1);
         //默认显示未删除商品
         //默认显示未删除商品
@@ -43,7 +44,10 @@ class ProductController extends BaseController
             $pyName = strtolower($py);
             $pyName = strtolower($py);
             $where['py'] = $pyName;
             $where['py'] = $pyName;
         }
         }
+        if ($requestType == 'changePrice') {
 
 
+        }
+        $where['stock>'] = 0;
         if (!empty($status)) {
         if (!empty($status)) {
             $where['status'] = $status;
             $where['status'] = $status;
         }
         }