| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <?php
- // +----------------------------------------------------------------------
- // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
- // +----------------------------------------------------------------------
- // | 版权所有 2017~2021 LARAVEL研发中心
- // +----------------------------------------------------------------------
- // | 官方网站: http://www.laravel.cn
- // +----------------------------------------------------------------------
- // | Author: laravel开发员 <laravel.qq.com>
- // +----------------------------------------------------------------------
- namespace App\Http\Controllers\Admin;
- use App\Services\Common\StoreService;
- /**
- * 商户管理-控制器
- * @author laravel开发员
- * @since 2020/11/11
- * @package App\Http\Controllers
- */
- class StoreController extends Backend
- {
- /**
- * 构造函数
- * @author laravel开发员
- * @since 2020/11/11
- */
- public function __construct()
- {
- parent::__construct();
- $this->service = new StoreService();
- }
- public function index()
- {
- $pageSize = request()->get('limit', 15);
- $params = request()->all();
- $params['store_id'] = $this->storeId;
- return $this->service->getDataList($params, $pageSize);
- }
- /**
- * 获取当前登录商家信息
- * @return array
- */
- public function currentInfo()
- {
- $service = new StoreService();
- $storeId = $this->storeId;
- return $service->getCurrentStoreInfo($storeId);
- }
- /**
- * 获取详情
- * @return array
- */
- public function info()
- {
- return $this->service->info();
- }
- /**
- * 审核商家
- * @return array
- */
- public function confirm()
- {
- $params = request()->post();
- if ($this->service->confirm($this->userId, $params)) {
- return message($this->service->getError(), true);
- } else {
- return message($this->service->getError(), false);
- }
- }
- /**
- * 设置状态(禁用/启用)
- * @return array
- */
- public function status()
- {
- $params = request()->post();
- if ($this->service->setStatus($params)) {
- return message($this->service->getError(), true);
- } else {
- return message($this->service->getError(), false);
- }
- }
- /**
- * 新增商家
- * @return array
- */
- public function add()
- {
- $params = request()->post();
- if ($this->service->add($params)) {
- return message($this->service->getError(), true);
- } else {
- return message($this->service->getError(), false);
- }
- }
- /**
- * 编辑商家
- * @return array
- */
- public function edit()
- {
- $params = request()->post();
- if ($this->service->edit($params)) {
- return message($this->service->getError(), true);
- } else {
- return message($this->service->getError(), false);
- }
- }
- /**
- * 删除商家
- * @return array
- */
- public function delete()
- {
- $params = request()->post();
- if ($this->service->delete($params)) {
- return message($this->service->getError(), true);
- } else {
- return message($this->service->getError(), false);
- }
- }
- /**
- * 选项列表
- * @return mixed
- */
- public function options()
- {
- $result = $this->service->options();
- return message(1002, true, $result);
- }
- }
|