ItemCatController.php 686 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace pt\controllers;
  3. use biz\item\classes\PtItemCatClass;
  4. use Yii;
  5. use common\components\util;
  6. class ItemCatController extends BaseController
  7. {
  8. public function actionList()
  9. {
  10. $get = Yii::$app->request->get();
  11. $type = $get['type'] ?? 0;
  12. $where = [];
  13. if (is_numeric($type)) {
  14. $where['type'] = $type;
  15. }
  16. $list = PtItemCatClass::getCatList($where);
  17. util::success($list);
  18. }
  19. //获取所有建议分类 ssh 20240127
  20. public function actionGetAllCat()
  21. {
  22. $list = PtItemCatClass::getAllByCondition(['type' => 0], null, '*', null);
  23. util::success(['list' => $list]);
  24. }
  25. }