commit | author | age
|
90c639
|
1 |
<?php |
Z |
2 |
|
|
3 |
namespace app\models; |
|
4 |
|
|
5 |
use Yii; |
|
6 |
use app\models\RechargeOrders; |
|
7 |
|
|
8 |
/** |
|
9 |
* This is the model class for table "{{%payment_order}}". |
|
10 |
* |
|
11 |
* @property int $id |
|
12 |
* @property int $payment_order_union_id |
|
13 |
* @property string $order_no |
|
14 |
* @property string $amount |
|
15 |
* @property int $is_pay 支付状态:0=未支付,1=已支付 |
|
16 |
* @property int $pay_type 支付方式:1=微信支付,2=货到付款,3=余额支付,4=支付宝支付,5=百度支付,6=头条支付, 7=微信H5支付,8支付宝H5支付,9.现金支付 10.pos机支付 |
|
17 |
* @property string $title |
|
18 |
* @property string $created_at |
|
19 |
* @property string $updated_at |
|
20 |
* @property string $notify_class |
|
21 |
* @property string $refund 已退款金额 |
|
22 |
* @property Order $order |
|
23 |
* @property PaymentOrderUnion paymentOrderUnion |
|
24 |
*/ |
|
25 |
class PaymentOrder extends ModelActiveRecord |
|
26 |
{ |
|
27 |
/** |
|
28 |
* {@inheritdoc} |
|
29 |
*/ |
|
30 |
public static function tableName() |
|
31 |
{ |
|
32 |
return '{{%payment_order}}'; |
|
33 |
} |
|
34 |
|
|
35 |
/** |
|
36 |
* {@inheritdoc} |
|
37 |
*/ |
|
38 |
public function rules() |
|
39 |
{ |
|
40 |
return [ |
|
41 |
[['payment_order_union_id', 'order_no', 'amount', 'title', 'notify_class'], 'required'], |
|
42 |
[['payment_order_union_id', 'is_pay', 'pay_type'], 'integer'], |
|
43 |
[['amount', 'refund'], 'number'], |
|
44 |
[['created_at', 'updated_at'], 'safe'], |
|
45 |
[['order_no'], 'string', 'max' => 32], |
|
46 |
[['title'], 'string', 'max' => 128], |
|
47 |
[['notify_class'], 'string', 'max' => 512], |
|
48 |
]; |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* {@inheritdoc} |
|
53 |
*/ |
|
54 |
public function attributeLabels() |
|
55 |
{ |
|
56 |
return [ |
|
57 |
'id' => 'ID', |
|
58 |
'payment_order_union_id' => 'Payment Order Union ID', |
|
59 |
'order_no' => 'Order No', |
|
60 |
'amount' => 'Amount', |
|
61 |
'is_pay' => '支付状态:0=未支付,1=已支付', |
|
62 |
'pay_type' => '支付方式:1=微信支付,2=货到付款,3=余额支付,4=支付宝支付,5=百度支付,6=头条支付, 7微信H5支付,8支付宝H5支付,9.现金支付 10.pos机支付', |
|
63 |
'title' => 'Title', |
|
64 |
'created_at' => 'Created At', |
|
65 |
'updated_at' => 'Updated At', |
|
66 |
'notify_class' => 'Notify Class', |
|
67 |
'refund' => '已退款金额', |
|
68 |
]; |
|
69 |
} |
|
70 |
|
|
71 |
public function getOrder() |
|
72 |
{ |
|
73 |
return $this->hasOne(Order::className(), ['order_no' => 'order_no']); |
|
74 |
} |
|
75 |
|
|
76 |
public function getReOrder() |
|
77 |
{ |
|
78 |
return $this->hasOne(RechargeOrders::className(), ['order_no' => 'order_no']); |
|
79 |
} |
|
80 |
|
|
81 |
public function getPaymentOrderUnion() |
|
82 |
{ |
|
83 |
return $this->hasOne(PaymentOrderUnion::className(), ['id' => 'payment_order_union_id']); |
|
84 |
} |
|
85 |
} |