master
cody 2 weeks ago
parent fcf76f98ac
commit 3b227ab929

@ -108,6 +108,38 @@ class OtherController extends CommonController
return $this->success($list); return $this->success($list);
} }
/**
* @OA\Get(
* path="/api/mobile/other/company-detail",
* tags={"小程序-其他"},
* summary="公司详情",
* @OA\Parameter(name="company_name", in="query", @OA\Schema(type="integer"), required=true, description="公司名字"),
* @OA\Response(
* response=200,
* description="操作成功"
* )
* )
*/
public function companyDetail()
{
$all = \request()->all();
$messages = [
'company_name.required' => '公司名称必填',
];
$validator = Validator::make($all, [
'company_name' => 'required',
], $messages);
if ($validator->fails()) {
return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
}
$YuanheRepository = new YuanheRepository();
$result = $YuanheRepository->companyInfo(['enterpriseName' => $all['company_name']]);
if (empty($result)) {
return $this->fail([ResponseCode::ERROR_PARAMETER, '无数据']);
}
return $this->success($result);
}
/** /**
* @OA\Get( * @OA\Get(
* path="/api/mobile/other/company-list", * path="/api/mobile/other/company-list",

@ -277,6 +277,8 @@ Route::group(["namespace" => "Mobile", "prefix" => "mobile"], function () {
Route::get('other/banner', [\App\Http\Controllers\Mobile\OtherController::class, "banner"]); Route::get('other/banner', [\App\Http\Controllers\Mobile\OtherController::class, "banner"]);
// 公司查询 // 公司查询
Route::get('other/company', [\App\Http\Controllers\Mobile\OtherController::class, "company"]); Route::get('other/company', [\App\Http\Controllers\Mobile\OtherController::class, "company"]);
// 公司详情
Route::get('other/company-detail', [\App\Http\Controllers\Mobile\OtherController::class, "companyDetail"]);
// 公司查询 // 公司查询
Route::get('other/company-list', [\App\Http\Controllers\Mobile\OtherController::class, "companyList"]); Route::get('other/company-list', [\App\Http\Controllers\Mobile\OtherController::class, "companyList"]);
// 通知 // 通知

Loading…
Cancel
Save