| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\admin\controllers;
- use app\models\District;
- use app\modules\admin\models\CardForm;
- use app\modules\admin\models\CashForm;
- use app\modules\admin\models\ShopForm;
- use app\modules\admin\models\ClerkForm;
- use app\modules\admin\models\ShopSettingForm;
- /**
- * Undocumented class
- *
- * @Author LGL 24963@qq.com
- * @DateTime 2021-01-13
- * @desc: 自提点管理
- */
- class ShopController extends BaseController
- {
-
- /**
- * Undocumented function
- *
- * @Author LGL 24963@qq.com
- * @DateTime 2021-01-13
- * @desc: 自提点列表
- * @return void
- */
- public function actionShopList()
- {
- $param = get_params();
- $form = new ShopForm();
- $form->scenario = $form::SCENARIO_LIST;
- $form->attributes = $param;
- return $this->asJson($form->searchShop());
- }
- /**
- * Undocumented function
- *
- * @Author LGL 24963@qq.com
- * @DateTime 2021-01-13
- * @desc: 商户添加
- */
- public function actionShopAdd()
- {
- $param = post_params();
- $form = new ShopForm();
- $form->scenario = $form::SCENARIO_ADD;
- $form->attributes = $param;
- $form->store_id = get_store_id();
- if ($param['begin_time']) {
- $form->begin_time = strtotime($param['begin_time']);
- }
- if ($param['end_time']) {
- $form->end_time = strtotime($param['end_time']);
- }
- $res = $form->saveShop();
- return $this->asJson($res);
- }
- /**
- * Undocumented function
- *
- * @Author LGL 24963@qq.com
- * @DateTime 2021-01-13
- * @desc: 自提点编辑
- */
- public function actionShopEdit()
- {
- $param = post_params();
- $form = new ShopForm();
- $form->scenario = $form::SCENARIO_EDIT;
- $form->attributes = $param;
- $form->store_id = get_store_id();
- if ($param['begin_time']) {
- $form->begin_time = strtotime($param['begin_time']);
- }
- if ($param['end_time']) {
- $form->end_time = strtotime($param['end_time']);
- }
- $res = $form->saveShop();
- return $this->asJson($res);
- }
- /**
- * Undocumented function
- *
- * @Author LGL 24963@qq.com
- * @DateTime 2021-01-13
- * @desc: 自提点删除
- * @return void
- */
- public function actionShopDel()
- {
- //主键id用key标识并进行获取
- $param = get_params('key');
- $form = new ShopForm();
- $form->scenario = $form::SCENARIO_DEL;
- $form->id = $param;
- $res = $form->delShop();
- return $this->asJson($res);
- }
- /**
- * Undocumented function
- *
- * @Author LGL 24963@qq.com
- * @DateTime 2021-01-14
- * @desc: 自提点审核
- * @return void
- */
- public function actionShopAudit()
- {
- $param = post_params();
- $form = new ShopForm();
- $form->scenario = $form::SCENARIO_AUDIT;
- $form->attributes = $param;
- $res = $form->auditShop();
- return $this->asJson($res);
- }
- /**
- * Undocumented function
- *
- * @Author LGL 24963@qq.com
- * @DateTime 2021-01-14
- * @desc: 核销员提现管理
- * @return void
- */
- public function actionShopCashList()
- {
- $param = get_params();
- $form = new CashForm();
- $form->scenario = $form::SCENARIO_LIST;
- $form->attributes = $param;
- return $this->asJson($form->searchShopCash());
- }
- /**
- * Undocumented function
- *
- * @Author LGL 24963@qq.com
- * @DateTime 2021-01-15
- * @desc: 核销员列表
- * @return void
- */
- public function actionClerkList()
- {
- $param = get_params();
- $form = new ClerkForm();
- $form->scenario = $form::SCENARIO_LIST;
- $form->attributes = $param;
- return $this->asJson($form->searchClerk());
- }
- /**
- * Undocumented function
- *
- * @Author LGL 24963@qq.com
- * @DateTime 2021-01-13
- * @desc: 商户添加
- * @return void
- */
- public function actionClerkAdd()
- {
- $param = post_params();
- $form = new ClerkForm();
- $form->scenario = $form::SCENARIO_ADD;
- $form->attributes = $param;
- $form->store_id = get_store_id();
- $res = $form->saveClerk();
- return $this->asJson($res);
- }
- /**
- * Undocumented function
- *
- * @Author LGL 24963@qq.com
- * @DateTime 2021-01-13
- * @desc: 自提点编辑
- * @return void
- */
- public function actionClerkEdit()
- {
- $param = post_params();
- $form = new ClerkForm();
- $form->scenario = $form::SCENARIO_EDIT;
- $form->attributes = $param;
- $form->store_id = get_store_id();
- $res = $form->saveClerk();
- return $this->asJson($res);
- }
- /**
- * Undocumented function
- *
- * @Author LGL 24963@qq.com
- * @DateTime 2021-01-13
- * @desc: 自提点删除
- * @return void
- */
- public function actionClerkDel()
- {
- //主键id用key标识并进行获取
- $param = get_params('key');
- $form = new ClerkForm();
- $form->scenario = $form::SCENARIO_DEL;
- $form->id = $param;
- $res = $form->delClerk();
- return $this->asJson($res);
- }
- /**
- * Undocumented function
- *
- * @Author LGL 24963@qq.com
- * @DateTime 2021-01-15
- * @desc: 自提点设置
- * @return void
- */
- public function actionShopSettingList()
- {
- $param = get_params();
- $form = new ShopSettingForm();
- $form->scenario = $form::SCENARIO_LIST;
- $form->attributes = $param;
- return $this->asJson([
- 'code' => 0,
- 'data' => $form->getShopSettingList()
- ]);
- }
- /**
- * Undocumented function
- *
- * @Author LGL 24963@qq.com
- * @DateTime 2021-03-18
- * @desc: 自提点设置保存
- * @return void
- */
- public function actionShopSettingEdit()
- {
- $param = post_params();
- $form = new ShopSettingForm();
- $form->scenario = $form::SCENARIO_EDIT;
- $form->attributes = $param;
- $res = $form->saveShopSetting();
- return $this->asJson($res);
- }
- }
|