Просмотр исходного кода

只显示库存大于0的花材

shish 4 лет назад
Родитель
Сommit
08eeb98f65
1 измененных файлов с 4 добавлено и 0 удалено
  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()
     {
         $py = Yii::$app->request->get('py', '');
+        $requestType = Yii::$app->request->get('requestType', 'common');
         //默认显示上架商品
         $status = Yii::$app->request->get('status', 1);
         //默认显示未删除商品
@@ -43,7 +44,10 @@ class ProductController extends BaseController
             $pyName = strtolower($py);
             $where['py'] = $pyName;
         }
+        if ($requestType == 'changePrice') {
 
+        }
+        $where['stock>'] = 0;
         if (!empty($status)) {
             $where['status'] = $status;
         }