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 "{{%goods_card_clerk_log}}". |
|
9 |
* |
|
10 |
* @property int $id |
|
11 |
* @property int $user_card_id 卡券ID |
|
12 |
* @property int $clerk_id 核销员ID |
|
13 |
* @property int $store_id 核销门店ID |
|
14 |
* @property int $use_number 核销次数 |
|
15 |
* @property int $surplus_number 剩余次数 |
|
16 |
* @property string $clerked_at 核销时间 |
|
17 |
* @property Store $store |
|
18 |
* @property User $user |
|
19 |
*/ |
|
20 |
class GoodsCardClerkLog extends ModelActiveRecord |
|
21 |
{ |
|
22 |
/** |
|
23 |
* {@inheritdoc} |
|
24 |
*/ |
|
25 |
public static function tableName() |
|
26 |
{ |
|
27 |
return '{{%goods_card_clerk_log}}'; |
|
28 |
} |
|
29 |
|
|
30 |
/** |
|
31 |
* {@inheritdoc} |
|
32 |
*/ |
|
33 |
public function rules() |
|
34 |
{ |
|
35 |
return [ |
|
36 |
[['user_card_id', 'clerk_id', 'store_id', 'use_number', 'clerked_at', 'surplus_number'], 'required'], |
|
37 |
[['user_card_id', 'clerk_id', 'store_id', 'use_number', 'surplus_number'], 'integer'], |
|
38 |
[['clerked_at'], 'safe'], |
|
39 |
]; |
|
40 |
} |
|
41 |
|
|
42 |
/** |
|
43 |
* {@inheritdoc} |
|
44 |
*/ |
|
45 |
public function attributeLabels() |
|
46 |
{ |
|
47 |
return [ |
|
48 |
'id' => 'ID', |
|
49 |
'user_card_id' => '用户卡券ID', |
|
50 |
'clerk_id' => '核销员ID', |
|
51 |
'store_id' => '核销门店ID', |
|
52 |
'use_number' => '核销次数', |
|
53 |
'surplus_number' => '剩余次数', |
|
54 |
'clerked_at' => '核销时间', |
|
55 |
]; |
|
56 |
} |
|
57 |
|
|
58 |
public function getStore() |
|
59 |
{ |
|
60 |
return $this->hasOne(Store::className(), ['id' => 'store_id']); |
|
61 |
} |
|
62 |
|
|
63 |
public function getUser() |
|
64 |
{ |
|
65 |
return $this->hasOne(User::className(), ['id' => 'clerk_id']); |
|
66 |
} |
|
67 |
|
|
68 |
public function getUserCard() |
|
69 |
{ |
|
70 |
return $this->hasOne(UserCard::className(), ['id' => 'user_card_id']); |
|
71 |
} |
|
72 |
} |