This commit is contained in:
51
app/Request/CompanyRequest.php
Normal file
51
app/Request/CompanyRequest.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Author: ykxiao
|
||||
* Date: 2025/6/4
|
||||
* Time: 下午2:54
|
||||
* Description:
|
||||
*
|
||||
* (c) ykxiao <yk_9001@hotmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Request;
|
||||
|
||||
use App\Constants\ActiveStatusConst;
|
||||
use App\Constants\CompanyTypeConst;
|
||||
|
||||
class CompanyRequest extends AbstractRequest
|
||||
{
|
||||
public array $scenes = [
|
||||
'addCompany' => [
|
||||
'id',
|
||||
'company_type',
|
||||
'name',
|
||||
'status',
|
||||
],
|
||||
];
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'id' => 'integer',
|
||||
'company_type' => 'required|in:' . implode(',', array_column(CompanyTypeConst::getConstantsList(), 'value')),
|
||||
'name' => 'required|string|max:128',
|
||||
'status' => 'integer|in:0,1',
|
||||
];
|
||||
}
|
||||
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'id' => '公司ID',
|
||||
'company_type' => '公司类型',
|
||||
'name' => '公司名称',
|
||||
'status' => '状态',
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user