| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- namespace app\modules\admin\controllers;
- use app\models\MdCategory;
- use app\modules\admin\models\MdCategoryForm;
- class MdCategoryController extends BaseController
- {
- /**
- * 列表
- */
- public function actionList()
- {
- $form = new MdCategoryForm();
- $form->attributes = get_params();
- $form->store_id = get_store_id();
- return $this->asJson($form->list());
- }
- /**
- * 保存
- */
- public function actionSave()
- {
- $form = new MdCategoryForm();
- $form->attributes = post_params();
- $form->store_id = get_store_id();
- return $this->asJson($form->save());
- }
- /**
- * 删除
- */
- public function actionDel()
- {
- $form = new MdCategoryForm();
- $form->attributes = post_params();
- $form->store_id = get_store_id();
- return $this->asJson($form->del());
- }
- /**
- * 修改状态
- */
- public function actionSetStatus()
- {
- $form = new MdCategoryForm();
- $form->attributes = post_params();
- $form->store_id = get_store_id();
- return $this->asJson($form->setStatus());
- }
- /**
- * 获取门店分类数据(订单金额)
- */
- public function actionGetMdCategoryData()
- {
- $form = new MdCategoryForm();
- $form->attributes = get_params();
- $form->id = get_params('cat_id');
- $form->store_id = get_store_id();
- return $this->asJson($form->getMdCategoryData());
- }
- /**
- * 获取门店分类数据 详情
- */
- public function actionGetMdCategoryDataDetail()
- {
- $form = new MdCategoryForm();
- $form->attributes = get_params();
- $form->store_id = get_store_id();
- return $this->asJson($form->getMdCategoryDataDetail());
- }
- public function actionGetMdCategory()
- {
- $store_id = get_store_id();
- return $this->asJson([
- 'code' => 0,
- 'msg' => '',
- 'data' => [
- 'list' => MdCategory::getList($store_id)
- ]
- ]);
- }
- }
|