commit | author | age
|
2207d6
|
1 |
<?php |
W |
2 |
|
|
3 |
namespace app\models; |
|
4 |
|
|
5 |
/** |
|
6 |
* This is the model class for table "{{%recharge}}". |
|
7 |
* |
|
8 |
* @property int $id |
|
9 |
* @property int $mall_id |
|
10 |
* @property string $name |
|
11 |
* @property string $pay_price 支付价格 |
|
12 |
* @property string $send_price 赠送价格 |
|
13 |
* @property int $is_delete 删除 |
|
14 |
* @property string $created_at |
|
15 |
* @property string $updated_at |
|
16 |
* @property string $deleted_at |
|
17 |
* @property int $send_integral 赠送的积分 |
|
18 |
* @property int $send_member_id 赠送的会员 |
|
19 |
*/ |
|
20 |
class Recharge extends ModelActiveRecord |
|
21 |
{ |
|
22 |
/** |
|
23 |
* {@inheritdoc} |
|
24 |
*/ |
|
25 |
public static function tableName() |
|
26 |
{ |
|
27 |
return '{{%recharge}}'; |
|
28 |
} |
|
29 |
|
|
30 |
/** |
|
31 |
* {@inheritdoc} |
|
32 |
*/ |
|
33 |
public function rules() |
|
34 |
{ |
|
35 |
return [ |
|
36 |
[['mall_id', 'name', 'pay_price', 'created_at', 'updated_at', 'deleted_at'], 'required'], |
|
37 |
[['mall_id', 'is_delete', 'send_integral', 'send_member_id'], 'integer'], |
|
38 |
[['pay_price', 'send_price'], 'number'], |
|
39 |
[['created_at', 'updated_at', 'deleted_at'], 'safe'], |
|
40 |
[['name'], '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 |
'name' => '名称', |
|
53 |
'pay_price' => '支付价格', |
|
54 |
'send_price' => '赠送价格', |
|
55 |
'is_delete' => '删除', |
|
56 |
'created_at' => 'Created At', |
|
57 |
'updated_at' => 'Update At', |
|
58 |
'deleted_at' => 'Deleted At', |
|
59 |
'send_integral' => '赠送的积分', |
|
60 |
'send_member_id' => '赠送的会员', |
|
61 |
]; |
|
62 |
} |
|
63 |
|
|
64 |
public function getMember() |
|
65 |
{ |
|
66 |
return $this->hasOne(MallMembers::className(), ['id' => 'send_member_id', 'is_delete' => 'is_delete']); |
|
67 |
} |
|
68 |
} |