commit | author | age
|
90c639
|
1 |
<?php |
Z |
2 |
|
|
3 |
namespace app\models; |
|
4 |
|
|
5 |
use Yii; |
|
6 |
|
|
7 |
/** |
|
8 |
* This is the model class for table "{{%share_order}}". |
|
9 |
* |
|
10 |
* @property int $id |
|
11 |
* @property int $mall_id |
|
12 |
* @property int $order_id |
|
13 |
* @property int $order_detail_id |
|
14 |
* @property int $user_id 购物者用户id |
|
15 |
* @property int $first_parent_id 上一级用户id |
|
16 |
* @property int $second_parent_id 上二级用户id |
|
17 |
* @property int $third_parent_id 上三级用户id |
|
18 |
* @property string $first_price 上一级分销佣金 |
|
19 |
* @property string $second_price 上二级分销佣金 |
|
20 |
* @property string $third_price 上三级分销佣金 |
|
21 |
* @property int $is_transfer 佣金发放状态:0=未发放,1=已发放 |
|
22 |
* @property int $is_refund 是否退款:0=未退款,1=已退款 |
|
23 |
* @property int $is_delete |
|
24 |
* @property string $created_at |
|
25 |
* @property string $updated_at |
|
26 |
* @property string $deleted_at |
|
27 |
* @property string $price 用于分销的金额 |
|
28 |
* @property int $first_share_type 一级分销的分销类型 |
|
29 |
* @property string $first_share_price 一级佣金 |
|
30 |
* @property int $second_share_type 二级分销的分销类型 |
|
31 |
* @property string $second_share_price 二级佣金 |
|
32 |
* @property int $third_share_type 三级分销的分销类型 |
|
33 |
* @property string $third_share_price 三级佣金 |
|
34 |
* @property int $flag 修改记录 0--售后优化之前的分销订单 1--售后优化之后的订单 |
|
35 |
* @property Order $order |
|
36 |
* @property User $user |
|
37 |
* @property OrderDetail $orderDetail |
|
38 |
*/ |
|
39 |
class ShareOrder extends ModelActiveRecord |
|
40 |
{ |
|
41 |
/** |
|
42 |
* {@inheritdoc} |
|
43 |
*/ |
|
44 |
public static function tableName() |
|
45 |
{ |
|
46 |
return '{{%share_order}}'; |
|
47 |
} |
|
48 |
|
|
49 |
/** |
|
50 |
* {@inheritdoc} |
|
51 |
*/ |
|
52 |
public function rules() |
|
53 |
{ |
|
54 |
return [ |
|
55 |
[['mall_id', 'order_id', 'order_detail_id', 'user_id'], 'required'], |
|
56 |
[['mall_id', 'order_id', 'order_detail_id', 'user_id', 'first_parent_id', 'second_parent_id', 'third_parent_id', 'is_refund', 'is_transfer', 'is_delete', 'first_share_type', 'second_share_type', 'third_share_type', 'flag'], 'integer'], |
|
57 |
[['first_price', 'second_price', 'third_price', 'price', 'first_share_price', 'second_share_price', 'third_share_price'], 'number'], |
|
58 |
[['created_at', 'updated_at', 'deleted_at'], 'safe'], |
|
59 |
]; |
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* {@inheritdoc} |
|
64 |
*/ |
|
65 |
public function attributeLabels() |
|
66 |
{ |
|
67 |
return [ |
|
68 |
'id' => 'ID', |
|
69 |
'mall_id' => 'Mall ID', |
|
70 |
'order_id' => 'Order ID', |
|
71 |
'order_detail_id' => 'Order Detail ID', |
|
72 |
'user_id' => '购物者用户id', |
|
73 |
'first_parent_id' => '上一级用户id', |
|
74 |
'second_parent_id' => '上二级用户id', |
|
75 |
'third_parent_id' => '上三级用户id', |
|
76 |
'first_price' => '上一级分销佣金', |
|
77 |
'second_price' => '上二级分销佣金', |
|
78 |
'third_price' => '上三级分销佣金', |
|
79 |
'is_refund' => '是否退款', |
|
80 |
'is_transfer' => '佣金发放状态:0=未发放,1=已发放', |
|
81 |
'is_delete' => 'Is Delete', |
|
82 |
'created_at' => 'Created At', |
|
83 |
'updated_at' => 'Updated At', |
|
84 |
'deleted_at' => 'Deleted At', |
|
85 |
'price' => '用于分销的金额', |
|
86 |
'first_share_type' => '一级分销的分销类型', |
|
87 |
'first_share_price' => '一级佣金', |
|
88 |
'second_share_type' => '二级分销的分销类型', |
|
89 |
'second_share_price' => '二级佣金', |
|
90 |
'third_share_type' => '三级分销的分销类型', |
|
91 |
'third_share_price' => '三级佣金', |
|
92 |
'flag' => '修改记录 0--售后优化之前的分销订单 1--售后优化之后的订单', |
|
93 |
]; |
|
94 |
} |
|
95 |
|
|
96 |
public function getOrder() |
|
97 |
{ |
|
98 |
return $this->hasOne(Order::className(), ['id' => 'order_id']); |
|
99 |
} |
|
100 |
|
|
101 |
public function getUser() |
|
102 |
{ |
|
103 |
return $this->hasOne(User::className(), ['id' => 'user_id']); |
|
104 |
} |
|
105 |
|
|
106 |
public function getOrderDetail() |
|
107 |
{ |
|
108 |
return $this->hasOne(OrderDetail::className(), ['id' => 'order_detail_id']); |
|
109 |
} |
|
110 |
} |