CpController.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace ghs\controllers;
  3. use bizGhs\cp\classes\CpClass;
  4. use common\components\util;
  5. use Yii;
  6. class CpController extends BaseController
  7. {
  8. //根据分类id取集合,带分页 ssh 20231228
  9. public function actionList()
  10. {
  11. $get = Yii::$app->request->get();
  12. $classId = $get['classId'] ?? 0;
  13. $mainId = $this->mainId ?? 0;
  14. $where = [];
  15. $where['mainId'] = $mainId;
  16. $where['delStatus'] = 0;
  17. if (!empty($classId)) {
  18. $where['classId'] = $classId;
  19. }
  20. $respond = CpClass::getJhList($where);
  21. util::success($respond);
  22. }
  23. //添加产品 ssh 20240106
  24. public function actionAddCp()
  25. {
  26. $post = Yii::$app->request->post();
  27. $post['mainId'] = $this->mainId;
  28. $post['adminId'] = $this->adminId;
  29. $staff = $this->shopAdmin;
  30. $staffName = $staff->name ?? '';
  31. $post['staffName'] = $staffName;
  32. $shop = $this->shop;
  33. CpClass::addCp($post, $shop);
  34. util::complete('添加成功');
  35. }
  36. public function actionUpdateCp()
  37. {
  38. util::complete();
  39. }
  40. }