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 "{{%coupon_center}}". |
|
9 |
* |
|
10 |
* @property int $id |
|
11 |
* @property int $mall_id |
|
12 |
* @property int $coupon_id 优惠券id |
|
13 |
* @property int $is_delete 删除 |
|
14 |
* @property string $created_at |
|
15 |
* @property string $deleted_at |
|
16 |
*/ |
|
17 |
class CouponCenter extends ModelActiveRecord |
|
18 |
{ |
|
19 |
/** |
|
20 |
* {@inheritdoc} |
|
21 |
*/ |
|
22 |
public static function tableName() |
|
23 |
{ |
|
24 |
return '{{%coupon_center}}'; |
|
25 |
} |
|
26 |
|
|
27 |
/** |
|
28 |
* {@inheritdoc} |
|
29 |
*/ |
|
30 |
public function rules() |
|
31 |
{ |
|
32 |
return [ |
|
33 |
[['mall_id', 'coupon_id', 'created_at', 'deleted_at'], 'required'], |
|
34 |
[['mall_id', 'coupon_id', 'is_delete'], 'integer'], |
|
35 |
[['created_at', 'deleted_at'], 'safe'], |
|
36 |
]; |
|
37 |
} |
|
38 |
|
|
39 |
/** |
|
40 |
* {@inheritdoc} |
|
41 |
*/ |
|
42 |
public function attributeLabels() |
|
43 |
{ |
|
44 |
return [ |
|
45 |
'id' => 'ID', |
|
46 |
'mall_id' => 'Mall ID', |
|
47 |
'coupon_id' => '优惠券id', |
|
48 |
'is_delete' => '删除', |
|
49 |
'created_at' => 'Created At', |
|
50 |
'deleted_at' => 'Deleted At', |
|
51 |
]; |
|
52 |
} |
|
53 |
|
|
54 |
public function getCoupon() |
|
55 |
{ |
|
56 |
return $this->hasOne(Coupon::className(), ['id' => 'coupon_id']); |
|
57 |
} |
|
58 |
} |