commit | author | age
|
2207d6
|
1 |
<?php |
W |
2 |
|
|
3 |
namespace app\models; |
|
4 |
|
|
5 |
use Yii; |
|
6 |
|
|
7 |
/** |
|
8 |
* This is the model class for table "{{%integral_log}}". |
|
9 |
* |
|
10 |
* @property int $id |
|
11 |
* @property int $mall_id |
|
12 |
* @property int $user_id |
|
13 |
* @property int $type 类型:1=收入,2=支出 |
|
14 |
* @property int $integral 变动积分 |
|
15 |
* @property string $desc 变动说明 |
|
16 |
* @property string $custom_desc 自定义详细说明|记录 |
|
17 |
* @property string $order_no 订单号 |
|
18 |
* @property string $created_at |
|
19 |
*/ |
|
20 |
class IntegralLog extends ModelActiveRecord |
|
21 |
{ |
|
22 |
/** |
|
23 |
* {@inheritdoc} |
|
24 |
*/ |
|
25 |
public static function tableName() |
|
26 |
{ |
|
27 |
return '{{%integral_log}}'; |
|
28 |
} |
|
29 |
|
|
30 |
/** |
|
31 |
* {@inheritdoc} |
|
32 |
*/ |
|
33 |
public function rules() |
|
34 |
{ |
|
35 |
return [ |
|
36 |
[['mall_id', 'user_id', 'type', 'integral', 'custom_desc', 'created_at'], 'required'], |
|
37 |
[['mall_id', 'user_id', 'type', 'integral'], 'integer'], |
|
38 |
[['custom_desc'], 'string'], |
|
39 |
[['created_at'], 'safe'], |
|
40 |
[['desc', 'order_no'], 'string', 'max' => 255], |
|
41 |
]; |
|
42 |
} |
|
43 |
|
|
44 |
/** |
|
45 |
* {@inheritdoc} |
|
46 |
*/ |
|
47 |
public function attributeLabels() |
|
48 |
{ |
|
49 |
return [ |
|
50 |
'id' => 'ID', |
|
51 |
'mall_id' => 'Mall ID', |
|
52 |
'user_id' => 'User ID', |
|
53 |
'type' => '类型:1=收入,2=支出', |
|
54 |
'integral' => '变动积分', |
|
55 |
'desc' => '变动说明', |
|
56 |
'custom_desc' => '自定义详细说明|记录', |
|
57 |
'order_no' => '订单号', |
|
58 |
'created_at' => 'Created At', |
|
59 |
]; |
|
60 |
} |
|
61 |
|
|
62 |
public function getUser() |
|
63 |
{ |
|
64 |
return $this->hasOne(User::ClassName(), ['id' => 'user_id']); |
|
65 |
} |
|
66 |
} |