commit | author | age
|
2207d6
|
1 |
<?php |
W |
2 |
|
|
3 |
namespace app\models; |
|
4 |
|
|
5 |
/** |
|
6 |
* This is the model class for table "{{%order_comments}}". |
|
7 |
* |
|
8 |
* @property int $id |
|
9 |
* @property int $mall_id |
|
10 |
* @property int $mch_id |
|
11 |
* @property int $order_id |
|
12 |
* @property int $order_detail_id |
|
13 |
* @property int $user_id |
|
14 |
* @property int $score 评分:1=差评,2=中评,3=好 |
|
15 |
* @property string $content 评价内容 |
|
16 |
* @property string $pic_url 评价图片 |
|
17 |
* @property int $is_show 是否显示:0.不显示|1.显示 |
|
18 |
* @property int $is_virtual 是否虚拟用户 |
|
19 |
* @property string $virtual_user 虚拟用户名 |
|
20 |
* @property string $virtual_avatar 虚拟头像 |
|
21 |
* @property string $reply_content 商家回复内容 |
|
22 |
* @property string $virtual_time 虚拟评价时间 |
|
23 |
* @property string $goods_id 商品ID |
|
24 |
* @property string $goods_warehouse_id 商品库ID |
|
25 |
* @property string $created_at |
|
26 |
* @property string $updated_at |
|
27 |
* @property string $deleted_at |
|
28 |
* @property int $is_delete |
|
29 |
* @property int $sign; |
|
30 |
* @property int $is_anonymous |
|
31 |
* @property int $is_top |
|
32 |
* @property User $user |
|
33 |
* @property Goods $goods |
|
34 |
* @property OrderDetail $detail |
|
35 |
* @property string $goods_info; |
|
36 |
*/ |
|
37 |
class OrderComments extends ModelActiveRecord |
|
38 |
{ |
|
39 |
/** |
|
40 |
* {@inheritdoc} |
|
41 |
*/ |
|
42 |
public static function tableName() |
|
43 |
{ |
|
44 |
return '{{%order_comments}}'; |
|
45 |
} |
|
46 |
|
|
47 |
/** |
|
48 |
* {@inheritdoc} |
|
49 |
*/ |
|
50 |
public function rules() |
|
51 |
{ |
|
52 |
return [ |
|
53 |
[['mall_id', 'order_id', 'order_detail_id', 'user_id', 'score', 'pic_url', 'created_at', 'updated_at', |
|
54 |
'deleted_at', 'mch_id', 'goods_warehouse_id'], 'required'], |
|
55 |
[['mall_id', 'order_id', 'order_detail_id', 'user_id', 'score', 'is_show', 'is_virtual', 'is_delete', |
|
56 |
'goods_id', 'is_anonymous', 'mch_id', 'goods_warehouse_id', 'is_top'], 'integer'], |
|
57 |
[['content', 'pic_url', 'reply_content', 'sign', 'goods_info'], 'string'], |
|
58 |
[['created_at', 'updated_at', 'deleted_at', 'virtual_time'], 'safe'], |
|
59 |
[['virtual_user', 'virtual_avatar', 'sign'], 'string', 'max' => 255], |
|
60 |
]; |
|
61 |
} |
|
62 |
|
|
63 |
/** |
|
64 |
* {@inheritdoc} |
|
65 |
*/ |
|
66 |
public function attributeLabels() |
|
67 |
{ |
|
68 |
return [ |
|
69 |
'id' => 'ID', |
|
70 |
'mall_id' => 'Mall ID', |
|
71 |
'mch_id' => 'Mch ID', |
|
72 |
'order_id' => 'Order ID', |
|
73 |
'order_detail_id' => 'Order Detail ID', |
|
74 |
'user_id' => 'User ID', |
|
75 |
'score' => '评分:1=差评,2=中评,3=好', |
|
76 |
'content' => '评价内容', |
|
77 |
'pic_url' => '评价图片', |
|
78 |
'is_show' => '是否显示:0.不显示|1.显示', |
|
79 |
'is_virtual' => '是否虚拟用户', |
|
80 |
'virtual_user' => '虚拟用户名', |
|
81 |
'virtual_avatar' => '虚拟头像', |
|
82 |
'virtual_time' => '虚拟评价时间', |
|
83 |
'goods_id' => '商品', |
|
84 |
'goods_warehouse_id' => '商品库ID', |
|
85 |
'reply_content' => '商家回复内容', |
|
86 |
'created_at' => 'Created At', |
|
87 |
'updated_at' => 'Updated At', |
|
88 |
'deleted_at' => 'Deleted At', |
|
89 |
'is_delete' => 'Is Delete', |
|
90 |
'is_anonymous' => '是否匿名', |
|
91 |
'is_top' => '是否置顶', |
|
92 |
'goods_info' => '规格相关信息', |
|
93 |
]; |
|
94 |
} |
|
95 |
|
|
96 |
public function getGoods() |
|
97 |
{ |
|
98 |
return $this->hasOne(Goods::className(), ['id' => 'goods_id']); |
|
99 |
} |
|
100 |
|
|
101 |
public function getUser() |
|
102 |
{ |
|
103 |
return $this->hasOne(User::className(), ['id' => 'user_id']); |
|
104 |
} |
|
105 |
|
|
106 |
public function getDetail() |
|
107 |
{ |
|
108 |
return $this->hasOne(OrderDetail::className(),['id' => 'order_detail_id']); |
|
109 |
} |
|
110 |
} |