8 changed files with 134 additions and 11 deletions
-
7app/Controller/v3/SearchController.php
-
19app/Model/v3/Goods.php
-
37app/Model/v3/Store.php
-
42app/Request/v3/SearchStoreRequest.php
-
34app/Service/v3/Implementations/SearchService.php
-
2app/Service/v3/Implementations/ShopCartService.php
-
2app/Service/v3/Interfaces/SearchServiceInterface.php
-
2app/Service/v3/Interfaces/ShopCartServiceInterface.php
@ -0,0 +1,42 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
|
|||
namespace App\Request\v3; |
|||
|
|||
use App\Request\BaseFormRequest; |
|||
|
|||
class SearchStoreRequest extends BaseFormRequest |
|||
{ |
|||
|
|||
/** |
|||
* Get the validation rules that apply to the request. |
|||
*/ |
|||
public function rules(): array |
|||
{ |
|||
return [ |
|||
'market_id' => 'required|nonempty|integer', |
|||
'type_id' => 'nonempty|integer', |
|||
'keyword' => 'nonempty', |
|||
'order_by' => 'nonempty|in:default,sales', |
|||
'sort' => 'nonempty|in:asc,desc', |
|||
'page' => 'nonempty|integer', |
|||
'pagesize' => 'nonempty|integer', |
|||
]; |
|||
} |
|||
|
|||
/** |
|||
* @return array |
|||
*/ |
|||
public function messages(): array |
|||
{ |
|||
return [ |
|||
'*.*' => ':attribute无效', |
|||
]; |
|||
} |
|||
|
|||
public function attributes(): array |
|||
{ |
|||
return parent::attributes(); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue