shish 2 лет назад
Родитель
Сommit
81ccf233ff

+ 10 - 1
app-ghs/controllers/JhClassController.php

@@ -2,9 +2,18 @@
 
 namespace ghs\controllers;
 
+use bizGhs\jh\classes\JhClassClass;
 use common\components\util;
 
 class JhClassController extends PublicController
 {
 
-}
+    //左侧菜单导航 ssh 20231228
+    public function actionGetMenu()
+    {
+        $mainId = $this->mainId ?? 0;
+        $list = JhClassClass::getAllByCondition(['mainId' => $mainId, 'delStatus' => 0], 'inTurn DESC', '*', null, true);
+        util::success(['list' => $list]);
+    }
+
+}

+ 18 - 0
app-ghs/controllers/JhController.php

@@ -2,9 +2,27 @@
 
 namespace ghs\controllers;
 
+use bizGhs\jh\classes\JhClass;
 use common\components\util;
+use Yii;
 
 class JhController extends PublicController
 {
 
+    //根据分类id取集合,带分页 ssh 20231228
+    public function actionList()
+    {
+        $get = Yii::$app->request->get();
+        $classId = $get['classId'] ?? 0;
+        $mainId = $this->mainId ?? 0;
+        $where = [];
+        $where['mainId'] = $mainId;
+        $where['delStatus'] = 0;
+        if (!empty($classId)) {
+            $where['classId'] = $classId;
+        }
+        $respond = JhClass::getJhList($where);
+        util::success($respond);
+    }
+
 }

+ 19 - 1
app-ghs/controllers/JhItemController.php

@@ -2,9 +2,27 @@
 
 namespace ghs\controllers;
 
+use bizGhs\jh\classes\JhItemClass;
 use common\components\util;
+use Yii;
 
 class JhItemController extends PublicController
 {
 
-}
+    //根据分类id取集合,带分页 ssh 20231228
+    public function actionList()
+    {
+        $get = Yii::$app->request->get();
+        $classId = $get['classId'] ?? 0;
+        $mainId = $this->mainId ?? 0;
+        $where = [];
+        $where['mainId'] = $mainId;
+        $where['delStatus'] = 0;
+        if (!empty($classId)) {
+            $where['classId'] = $classId;
+        }
+        $respond = JhItemClass::getItemList($where);
+        util::success($respond);
+    }
+
+}

+ 6 - 0
biz-ghs/jh/classes/JhClass.php

@@ -9,4 +9,10 @@ class JhClass extends BaseClass
 
     public static $baseFile = '\bizGhs\jh\models\Jh';
 
+    public static function getJhList($where)
+    {
+        $data = self::getList('*', $where, 'addTime DESC');
+        return $data;
+    }
+
 }

+ 7 - 0
biz-ghs/jh/classes/JhItemClass.php

@@ -9,4 +9,11 @@ class JhItemClass extends BaseClass
 
     public static $baseFile = '\bizGhs\jh\models\JhItem';
 
+
+    public static function getItemList($where)
+    {
+        $data = self::getList('*', $where, 'addTime DESC');
+        return $data;
+    }
+
 }