post(); $pageSize = request()->post('pageSize', 15); $datas = StoreService::make()->getDataList($params, $pageSize); return showJson(1010, true, $datas); } /** * 行业分类 * @return array */ public function categorys() { $datas = StoreService::make()->getCategoryList(); return showJson(1010, true, $datas); } /** * 详情 * @return array */ public function info() { $params = request()->all(); $id = isset($params['id'])? $params['id'] : 0; try { if(!$result = StoreService::make()->getInfo($id)){ return showJson(1009, false); }else{ return showJson(1010, true, $result); } } catch (\Exception $exception) { $error = ['data' => $exception->getTrace(), 'err' => $exception->getMessage()]; return showJson(1046, false, $error); } } /** * 详情 * @return array */ public function applyInfo() { $params = request()->all(); $uid = isset($params['uid'])? $params['uid'] : 0; $uid = $uid? $uid : $this->userId; try { if(!$result = StoreService::make()->getApplyInfo($uid)){ return showJson(1009, false); }else{ return showJson(1010, true, $result); } } catch (\Exception $exception) { $error = ['data' => $exception->getTrace(), 'err' => $exception->getMessage()]; return showJson(1046, false, $error); } } /** * 添加 * @param StoreValidator $validator * @return array */ public function apply(StoreValidator $validator) { $params = request()->all(); $params = $validator->check($params, 'apply'); if (!is_array($params)) { return showJson($params, false); } try { if(!$result = StoreService::make()->apply($this->userId, $params)){ return showJson(StoreService::make()->getError(), false); }else{ return showJson(StoreService::make()->getError(), true, $result); } } catch (\Exception $exception) { $error = ['data' => $exception->getTrace(), 'err' => $exception->getMessage()]; return showJson(1046, false, $error); } } /** * 删除 * @return array|mixed */ public function delete() { if(!StoreService::make()->delete()){ return showJson(StoreService::make()->getError(), false); }else{ return showJson(StoreService::make()->getError(), true); } } }