// +---------------------------------------------------------------------- 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 mixed */ public function options() { $result = $this->service->options(); return message(1002, true, $result); } }