ReserveSettingController.php 850 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace addons\Store\client\controllers;
  3. use addons\Store\common\services\StoreReserveSettingService;
  4. class ReserveSettingController extends BaseController{
  5. public function actionIndex()
  6. {
  7. $retuest = \Yii::$app->request;
  8. if ($retuest->isAjax) {
  9. if ($retuest->isPost) {
  10. $params = \Yii::$app->request->post();
  11. (new StoreReserveSettingService(['mall_id'=>$this->mall_id,'store_id'=>$this->store_id]))->edit($params);
  12. $this->success('获取成功', []);
  13. } else {
  14. $setting = (new StoreReserveSettingService(['mall_id'=>$this->mall_id,'store_id'=>$this->store_id]))->detail();
  15. $this->success('获取成功', ['setting'=>$setting??[]]);
  16. }
  17. }
  18. return $this->render($this->action->id);
  19. }
  20. }