diff --git a/app/common/controller/UsedCarController.php b/app/common/controller/UsedCarController.php new file mode 100644 index 0000000..a1a0ffc --- /dev/null +++ b/app/common/controller/UsedCarController.php @@ -0,0 +1,33 @@ +service = new UsedCarService(); + } + + /** + * 列表页数据格式化 + * + * @param array $data + * @return array + */ + // protected function indexFormat($data) + // { + // if (isset($data['created_at'])) + // $data['created_at'] = date('Y-m-d H:i:s', $data['created_at']); + // if (isset($data['updated_at'])) + // $data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']); + // return $data; + // } +} \ No newline at end of file diff --git a/app/common/logic/AuthLogic.php b/app/common/logic/AuthLogic.php index 15d0b1c..e22ab77 100644 --- a/app/common/logic/AuthLogic.php +++ b/app/common/logic/AuthLogic.php @@ -36,7 +36,6 @@ class AuthLogic public function feishuLogin(array $data): array { $feishuUserInfo = $this->getFeishuUserInfo($data); - var_dump($feishuUserInfo); return $feishuUserInfo; $user = $this->getOrCreateUser($feishuUserInfo); @@ -202,10 +201,11 @@ class AuthLogic if(empty($app[$data['app_id']])){ throw new BusinessException('app_id非法'); } - $feishu = new Feishu($data['app_id'], $app[$data['app_id']]); + $fsAppInfo = CorpFeishuApp::where('app_id', $data['app_id'])->first(); + $feishu = new Feishu($data['app_id'], $fsAppInfo['feishu']); //回调地址 - $redirect_uri = $data['r_url']; + $redirect_uri = $fsAppInfo['r_url']; $userAccessToken = $feishu->userAccessToken($data['feishu_code'], $redirect_uri); $userInfo = $feishu->userInfo($userAccessToken['access_token']); @@ -303,7 +303,6 @@ class AuthLogic public function feishuAppInfo(string $app_id, string $systemCode) { $fsAppInfo = CorpFeishuApp::where('app_id', $app_id)->first(); - var_dump($fsAppInfo); return [ 'app_id' => $fsAppInfo->app_id, 'app_secret' => $fsAppInfo->app_secret, diff --git a/app/common/logic/UsedCarLogic.php b/app/common/logic/UsedCarLogic.php new file mode 100644 index 0000000..a8d9108 --- /dev/null +++ b/app/common/logic/UsedCarLogic.php @@ -0,0 +1,17 @@ +validator; + } +} \ No newline at end of file diff --git a/app/common/validate/UsedCarValidate.php b/app/common/validate/UsedCarValidate.php new file mode 100644 index 0000000..7a22c1e --- /dev/null +++ b/app/common/validate/UsedCarValidate.php @@ -0,0 +1,29 @@ + [ + + ], + + 'update' => [ + + ] + ]; +} \ No newline at end of file diff --git a/app/controller/IndexController.php b/app/controller/IndexController.php index 08922ab..d13af2f 100644 --- a/app/controller/IndexController.php +++ b/app/controller/IndexController.php @@ -74,25 +74,25 @@ class IndexController $options = [ 'controller' => [ 'module' => 'common', - 'name' => 'inv_requisition_item_return_attachment' + 'name' => 'used_car' ], 'model' => [ 'module' => 'common', - 'name' => 'inv_requisition_item_return_attachment' + 'name' => 'used_car' ], 'service' => [ 'module' => 'common', - 'name' => 'inv_requisition_item_return_attachment' + 'name' => 'used_car' ], 'logic' => [ 'module' => 'common', - 'name' => 'inv_requisition_item_return_attachment' + 'name' => 'used_car' ], 'validate' => [ 'module' => 'common', - 'name' => 'inv_requisition_item_return_attachment' + 'name' => 'used_car' ], - 'table' => 'inv_requisition_item_return_attachment' + 'table' => 'used_car' ]; $result = (new Generate($options))->doGenerate(); diff --git a/config/route.php b/config/route.php index 20a03fb..2597f6b 100644 --- a/config/route.php +++ b/config/route.php @@ -58,4 +58,12 @@ Route::group('/common', function () { Route::any('/team', [app\common\controller\UserController::class, 'team']); Route::any('/resign', [app\common\controller\UserController::class, 'resignMember']); }); + + Route::group('/usedcar', function () { + Route::any('/list', [app\common\controller\UsedCarController::class, 'index']); + Route::any('/show', [app\common\controller\UsedCarController::class, 'show']); + Route::any('/store', [app\common\controller\UsedCarController::class, 'store']); + Route::any('/update', [app\common\controller\UsedCarController::class, 'update']); + Route::any('/destroy', [app\common\controller\UsedCarController::class, 'destroy']); + }); }); \ No newline at end of file