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 "{{%mall_goods}}". |
|
9 |
* |
|
10 |
* @property int $id |
|
11 |
* @property int $mall_id |
|
12 |
* @property int $goods_id |
|
13 |
* @property int $is_quick_shop 是否快速购买 |
|
14 |
* @property int $is_sell_well 是否热销 |
|
15 |
* @property int $is_negotiable 是否面议商品 |
|
16 |
* @property string $created_at |
|
17 |
* @property string $updated_at |
|
18 |
* @property string $deleted_at |
|
19 |
* @property int $is_delete |
|
20 |
* @property GoodsWarehouse $goodsWarehouse |
|
21 |
* @property Goods $goods |
|
22 |
*/ |
|
23 |
class MallGoods extends ModelActiveRecord |
|
24 |
{ |
|
25 |
/** |
|
26 |
* {@inheritdoc} |
|
27 |
*/ |
|
28 |
public static function tableName() |
|
29 |
{ |
|
30 |
return '{{%mall_goods}}'; |
|
31 |
} |
|
32 |
|
|
33 |
/** |
|
34 |
* {@inheritdoc} |
|
35 |
*/ |
|
36 |
public function rules() |
|
37 |
{ |
|
38 |
return [ |
|
39 |
[['mall_id', 'goods_id', 'created_at'], 'required'], |
|
40 |
[['mall_id', 'goods_id', 'is_quick_shop', 'is_sell_well', 'is_negotiable', 'is_delete'], 'integer'], |
|
41 |
[['created_at', 'updated_at', 'deleted_at'], 'safe'], |
|
42 |
]; |
|
43 |
} |
|
44 |
|
|
45 |
/** |
|
46 |
* {@inheritdoc} |
|
47 |
*/ |
|
48 |
public function attributeLabels() |
|
49 |
{ |
|
50 |
return [ |
|
51 |
'id' => 'ID', |
|
52 |
'mall_id' => 'Mall ID', |
|
53 |
'goods_id' => 'Goods ID', |
|
54 |
'is_quick_shop' => '是否快速购买', |
|
55 |
'is_sell_well' => '是否热销', |
|
56 |
'is_negotiable' => '是否面议商品', |
|
57 |
'created_at' => 'Created At', |
|
58 |
'updated_at' => 'Updated At', |
|
59 |
'deleted_at' => 'Deleted At', |
|
60 |
'is_delete' => 'Is Delete', |
|
61 |
]; |
|
62 |
} |
|
63 |
|
|
64 |
public function getGoods() |
|
65 |
{ |
|
66 |
return $this->hasOne(Goods::className(), ['id' => 'goods_id']); |
|
67 |
} |
|
68 |
|
|
69 |
public function getGoodsWarehouse() |
|
70 |
{ |
|
71 |
return $this->hasOne(GoodsWarehouse::className(), ['id' => 'goods_warehouse_id']) |
|
72 |
->via('goods'); |
|
73 |
} |
|
74 |
} |