| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace ghs\controllers;
- use bizGhs\cp\classes\CpClass;
- use common\components\util;
- use Yii;
- class CpController extends BaseController
- {
- //根据分类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 = CpClass::getJhList($where);
- util::success($respond);
- }
- //添加产品 ssh 20240106
- public function actionAddCp()
- {
- $post = Yii::$app->request->post();
- $post['mainId'] = $this->mainId;
- $post['adminId'] = $this->adminId;
- $staff = $this->shopAdmin;
- $staffName = $staff->name ?? '';
- $post['staffName'] = $staffName;
- $shop = $this->shop;
- CpClass::addCp($post, $shop);
- util::complete('添加成功');
- }
- public function actionUpdateCp()
- {
- util::complete();
- }
- }
|