shish 3 lat temu
rodzic
commit
48b7331573

+ 7 - 0
app-ghs/controllers/WlController.php

@@ -16,4 +16,11 @@ class WlController extends BaseController
         util::success(['list' => $list]);
     }
 
+    public function actionList()
+    {
+        $where = ['mainId' => $this->mainId];
+        $list = WlClass::getWlList($where);
+        util::success($list);
+    }
+
 }

+ 11 - 0
biz-ghs/merchant/classes/WlClass.php

@@ -11,4 +11,15 @@ class WlClass extends BaseClass
 
     public static $baseFile = '\bizGhs\merchant\models\Wl';
 
+    public static function getWlList($where)
+    {
+        $data = self::getList('*', $where, 'inTurn DESC');
+        $list = isset($data['list']) && !empty($data['list']) ? $data['list'] : [];
+        if (empty($list)) {
+            return $data;
+        }
+        $data['list'] = $list;
+        return $data;
+    }
+
 }