You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

141 lines
4.9 KiB

<?php
/**
* 其他
*/
namespace App\Http\Controllers\Mobile;
use App\Helpers\ResponseCode;
use App\Models\AppointmentConfig;
use App\Models\AppointmentType;
use App\Models\Banner;
use App\Models\Config;
use App\Repositories\YuanheRepository;
use Illuminate\Support\Facades\Validator;
class OtherController extends CommonController
{
/**
* @OA\Get(
* path="/api/mobile/other/config",
* tags={"小程序-其他"},
* summary="获取配置信息",
* @OA\Parameter(name="appointment_type_id", in="query", @OA\Schema(type="integer"), required=true, description="场地类型"),
* @OA\Response(
* response=200,
* description="操作成功"
* )
* )
*/
public function config()
{
$all = request()->all();
$config = Config::get();
$appointment = AppointmentConfig::where(function ($query) use ($all) {
if (isset($all['appointment_type_id'])) {
$query->where('appointment_type_id', $all['appointment_type_id']);
}
})->where('show_front', 1)->get();
// 场地类型
$appointment_type = AppointmentType::get();
return $this->success(compact('config', 'appointment', 'appointment_type'));
}
/**
* @OA\Get(
* path="/api/mobile/other/banner",
* tags={"小程序-其他"},
* summary="获取banner",
* @OA\Parameter(name="position", in="query", @OA\Schema(type="integer"), required=true, description="位置1首页"),
* @OA\Response(
* response=200,
* description="操作成功"
* )
* )
*/
public function banner()
{
$position = request('position', 1);
$config = Banner::with('image')->where(function ($query) use ($position) {
if (isset($position)) {
$query->where('position', $position);
}
})->orderBy('sort')->get();
return $this->success($config);
}
/**
* @OA\Get(
* path="/api/mobile/other/company",
* tags={"小程序-其他"},
* summary="公司搜索",
* @OA\Parameter(name="company_name", in="query", @OA\Schema(type="integer"), required=true, description="公司名字"),
* @OA\Response(
* response=200,
* description="操作成功"
* )
* )
*/
public function company()
{
$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']]);
// $result = [
// "createBy" => null,
// "createDt" => null,
// "updateBy" => null,
// "updateDt" => null,
// "enterpriseId" => "1950060660573786112",
// "enterpriseName" => "苏州元瞰科技有限公司",
// "creditCode" => "91320594MA7F0G9W6A",
// "keyNo" => "db5ppy5kbsprbbhjbjlarvmvphjhp3mrkv",
// "isAbroad" => "0",
// "status" => "注销",
// "logo" => "https://image.qcc.com/logo/EntImage.png",
// "operName" => "刘杰杰",
// "contactMail" => "425039148@qq.com",
// "contactPhone" => "15298866552",
// "startDate" => "2021-12-21",
// "endDate" => null,
// "updatedDate" => "2025-08-17",
// "registCapi" => "100万元",
// "registAmount" => "1000000.0000",
// "registCapiType" => "1",
// "currencyType" => null, ,
// "termStart" => "2021-12-21",
// "termEnd" => null,
// "checkDate" => "2025-07-03",
// "orgNo" => "MA7F0G9W-6",
// "isOnStock" => "0",
// "stockNumber" => "",
// "stockType" => "",
// "stockDate" => null,
// "province" => "江苏省",
// "city" => "苏州市",
// "country" => "苏州工业园区",
// "areaCode" => "320576",
// "address" => "苏州工业园区亭新街11号B1栋二楼",
// "businessScope" => "一般项目:人工智能应用软件开发;人工智能基础软件开发;人工智能理论与算法软件开发;软件销售;软件开发;技术服务、技术开发、",
// "tagList" => null,
// "qccIndustry" => null,
// "isYhInvested" => false
// ];
if (!$result) {
return $this->fail([ResponseCode::ERROR_PARAMETER, '获取失败']);
}
return $this->success($result);
}
}