60 lines
1.4 KiB
PHP
60 lines
1.4 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @author Any
|
|
* @description KISS
|
|
* @date 2021年8月13日
|
|
* @version 1.0.0
|
|
*
|
|
* _____LOG_____
|
|
*
|
|
*/
|
|
namespace app\models\common\payment;
|
|
|
|
|
|
use app\models\UniqueOrderNo;
|
|
use app\models\Model;
|
|
|
|
|
|
class PaymentOrder extends Model
|
|
{
|
|
|
|
public $orderNo;
|
|
public $amount;
|
|
public $title;
|
|
public $notifyClass;
|
|
public $supportPayTypes;
|
|
public $payType;
|
|
|
|
public function rules()
|
|
{
|
|
return [
|
|
[['orderNo', 'amount', 'title', 'notifyClass'], 'required',],
|
|
[['orderNo'], 'string', 'max' => 32],
|
|
[['title'], 'string', 'max' => 128],
|
|
[['notifyClass'], 'string', 'max' => 512],
|
|
[['amount'], function ($attribute, $params) {
|
|
if (!is_float($this->amount)) {
|
|
$this->addError($attribute, '`amount`必须是数字类型。');
|
|
}
|
|
}],
|
|
[['amount'], 'number', 'min' => 0, 'max' => 100000000],
|
|
[['payType'], 'safe'],
|
|
[['supportPayTypes'], 'safe'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* PaymentOrder constructor.
|
|
* @param array $config
|
|
*/
|
|
public function __construct(array $config = [])
|
|
{
|
|
parent::__construct($config);
|
|
if(!$this->validate()){
|
|
$this->dde([$this->errors, $this->amount]);
|
|
}
|
|
}
|
|
}
|
|
|