shish пре 4 година
родитељ
комит
ca9dc98b67
1 измењених фајлова са 24 додато и 0 уклоњено
  1. 24 0
      app-hd/controllers/ProductController.php

+ 24 - 0
app-hd/controllers/ProductController.php

@@ -20,6 +20,30 @@ class ProductController extends BaseController
 
     public $guestAccess = ['ghs-item'];
 
+    //所有花材
+    public function actionAll()
+    {
+        $where = [];
+        $where['mainId'] = $this->mainId;
+        $classId = Yii::$app->request->get('classId', 0);
+        if (!empty($classId)) {
+            $where['classId'] = $classId;
+        }
+        $status = Yii::$app->request->get('status', 0);
+        if (!empty($status)) {
+            $where['status'] = $status;
+        }
+        $delStatus = Yii::$app->request->get('delStatus', 0);
+        if ($delStatus != 2) {
+            $where['delStatus'] = $delStatus;
+        }
+        //输出标准会员价,即花店价,默认显示的是花店价
+        $level = 1;
+        $data = ProductClass::getAllByCondition($where, ['actualSold' => SORT_DESC, 'inTurn' => SORT_DESC], "*");
+        $data = ProductClass::groupProductInfo($data, $level);
+        util::success(['list' => $data]);
+    }
+
     public function actionIndex()
     {
         $py = Yii::$app->request->get('py', '');