Browse Source

更新购物车

master
Lemon 6 years ago
parent
commit
abdcf41938
  1. 43
      app/Request/ShopCarRequest.php
  2. 43
      app/Request/UpdateShopCarRequest.php

43
app/Request/ShopCarRequest.php

@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
namespace App\Request;
use Hyperf\Validation\Request\FormRequest;
class UpdateShopCarRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'id' => 'required|nonempty|integer|exists_enable:ims_cjdc_shopcar,id',
];
}
public function messages(): array
{
return [
'id.exists_enable' => ':attribute不存在或被禁用',
'service_personnel_id.*' => ':attribute信息不正确'
];
}
public function attributes(): array
{
return [
'id' => '购物车记录',
];
}
}

43
app/Request/UpdateShopCarRequest.php

@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
namespace App\Request;
use Hyperf\Validation\Request\FormRequest;
class PersonnelRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'service_personnel_id' => 'required|nonempty|integer|exists_enable:lanzu_service_personnel,id,status=1',
];
}
public function messages(): array
{
return [
'service_personnel_id.exists_enable' => ':attribute不存在或被禁用',
'service_personnel_id.*' => ':attribute信息不正确'
];
}
public function attributes(): array
{
return [
'service_personnel_id' => '服务专员',
];
}
}
Loading…
Cancel
Save