| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- namespace ghs\controllers;
- use bizHd\saas\services\SetMealService;
- use Yii;
- use common\components\util;
- class SetMealController extends BaseController
- {
- public $guestAccess = ['get-detail'];
- //套餐列表 ssh 2019.12.8
- public function actionList()
- {
- $fest = SetMealService::getAllByCondition([], null, '*');
- util::success($fest);
- }
-
- //添加套餐 ssh 2019.12.21
- public function actionAdd()
- {
- $post = Yii::$app->request->post();
- $return = SetMealService::add($post);
- util::success($return);
- }
-
- //修改套餐 ssh 2019.12.21
- public function actionUpdate()
- {
- $post = Yii::$app->request->post();
- $id = $post['id'];
- unset($post['id']);
- SetMealService::updateById($id, $post);
- util::complete();
- }
-
- //套餐详情 ssh 2019.12.21
- public function actionDetail()
- {
- $id = Yii::$app->request->get('id');
- $fest = SetMealService::getById($id);
- util::success($fest);
- }
-
- //花店老板查看套餐详情 ssh 2020.1.11
- public function actionGetDetail()
- {
- $id = Yii::$app->request->get('id', 1);
- $detail = SetMealService::getSetById($id);
- $detail['introduce'] = '可以满足日常的经营、管理和营销需求。';
- $function = [
- ['name' => '线上商城', 'has' => 1],
- ['name' => '销售开单', 'has' => 1],
- ['name' => '智能改价', 'has' => 1],
- ['name' => '采购入库', 'has' => 1],
- ['name' => '欠款管理', 'has' => 1],
- ['name' => '门店管理', 'has' => 1],
- ['name' => '花材功能', 'has' => 1],
- ['name' => '库存管理', 'has' => 1],
- ['name' => '调拨出库', 'has' => 1],
- ['name' => '调拨入库', 'has' => 1],
- ['name' => '员工管理', 'has' => 1],
- ['name' => '订单管理', 'has' => 1],
- ['name' => '发货管理', 'has' => 1],
- ['name' => '客户管理', 'has' => 1],
- ];
- $free = rand(0, 1);
- $data = ['detail' => $detail, 'function' => $function, 'free' => $free];
- util::success($data);
- }
-
- }
|