9 changed files with 190 additions and 3 deletions
-
2app/Constants/LogLabel.php
-
15app/Controller/OrderController.php
-
30app/Model/Market.php
-
3app/Model/OrderMain.php
-
39app/Request/UserOrdersRequest.php
-
6app/Service/FinancialRecordService.php
-
80app/Service/OrderService.php
-
17app/Service/OrderServiceInterface.php
-
1config/routes.php
@ -0,0 +1,30 @@ |
|||||
|
<?php |
||||
|
|
||||
|
declare (strict_types=1); |
||||
|
namespace App\Model; |
||||
|
|
||||
|
/** |
||||
|
*/ |
||||
|
class Market extends Model |
||||
|
{ |
||||
|
/** |
||||
|
* The table associated with the model. |
||||
|
* |
||||
|
* @var string |
||||
|
*/ |
||||
|
protected $table = 'ims_cjdc_market'; |
||||
|
/** |
||||
|
* The attributes that are mass assignable. |
||||
|
* |
||||
|
* @var array |
||||
|
*/ |
||||
|
protected $fillable = []; |
||||
|
/** |
||||
|
* The attributes that should be cast to native types. |
||||
|
* |
||||
|
* @var array |
||||
|
*/ |
||||
|
protected $casts = []; |
||||
|
|
||||
|
public $timestamps = false; |
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
<?php |
||||
|
|
||||
|
declare(strict_types=1); |
||||
|
|
||||
|
namespace App\Request; |
||||
|
|
||||
|
use Hyperf\Validation\Request\FormRequest; |
||||
|
|
||||
|
class UserOrdersRequest 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 [ |
||||
|
'user_id' => 'required|nonempty|integer', |
||||
|
'market_id' => 'required|nonempty|integer', |
||||
|
'state' => 'required|integer', |
||||
|
'page' => 'required|nonempty|integer', |
||||
|
'pagesize' => 'required|nonempty|integer', |
||||
|
]; |
||||
|
} |
||||
|
|
||||
|
public function messages(): array |
||||
|
{ |
||||
|
return [ |
||||
|
'*.*' => ':attribute 参数不正确', |
||||
|
]; |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue