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 "{{%user_platform}}". |
|
9 |
* |
|
10 |
* @property int $id |
|
11 |
* @property int $mall_id |
|
12 |
* @property int $user_id |
|
13 |
* @property string $platform 用户所属平台标识 |
|
14 |
* @property string $platform_id 用户所属平台的用户id |
|
15 |
* @property string $password h5平台使用的密码 |
|
16 |
* @property string $unionid 微信平台使用的unionid |
|
17 |
* @property int $subscribe 微信平台使用的是否关注 |
|
18 |
* @property User $user |
|
19 |
*/ |
|
20 |
class UserPlatform extends \app\models\ModelActiveRecord |
|
21 |
{ |
|
22 |
/** |
|
23 |
* {@inheritdoc} |
|
24 |
*/ |
|
25 |
public static function tableName() |
|
26 |
{ |
|
27 |
return '{{%user_platform}}'; |
|
28 |
} |
|
29 |
|
|
30 |
/** |
|
31 |
* {@inheritdoc} |
|
32 |
*/ |
|
33 |
public function rules() |
|
34 |
{ |
|
35 |
return [ |
|
36 |
[['mall_id', 'user_id'], 'required'], |
|
37 |
[['mall_id', 'user_id', 'subscribe'], 'integer'], |
|
38 |
[['platform', 'platform_id', 'password', 'unionid'], 'string', 'max' => 255], |
|
39 |
]; |
|
40 |
} |
|
41 |
|
|
42 |
/** |
|
43 |
* {@inheritdoc} |
|
44 |
*/ |
|
45 |
public function attributeLabels() |
|
46 |
{ |
|
47 |
return [ |
|
48 |
'id' => 'ID', |
|
49 |
'mall_id' => 'Mall ID', |
|
50 |
'user_id' => 'User ID', |
|
51 |
'platform' => '用户所属平台标识', |
|
52 |
'platform_id' => '用户所属平台的用户id', |
|
53 |
'password' => 'h5平台使用的密码', |
|
54 |
'unionid' => '微信平台使用的unionid', |
|
55 |
'subscribe' => '微信平台使用的是否关注', |
|
56 |
]; |
|
57 |
} |
|
58 |
|
|
59 |
public function getUser() |
|
60 |
{ |
|
61 |
return $this->hasOne(User::className(), ['id' => 'user_id']); |
|
62 |
} |
|
63 |
} |