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 "{{%printer_setting}}". |
|
9 |
* |
|
10 |
* @property int $id |
|
11 |
* @property int $mall_id |
|
12 |
* @property int $mch_id |
|
13 |
* @property int $printer_id 打印机id |
|
14 |
* @property int $block_id 模板id |
|
15 |
* @property int $is_attr 0不使用规格 1使用规格 |
|
16 |
* @property string $type 打印方式 |
|
17 |
* @property string $big 倍数 |
|
18 |
* @property string $status 是否启用 |
|
19 |
* @property int $store_id 门店ID |
|
20 |
* @property int $is_delete 删除 |
|
21 |
* @property string $created_at |
|
22 |
* @property string $updated_at |
|
23 |
* @property string $deleted_at |
|
24 |
* @property Printer $printer |
|
25 |
* @property Store $store |
|
26 |
* @property int $show_type |
|
27 |
* @property string $order_send_type |
|
28 |
*/ |
|
29 |
class PrinterSetting extends ModelActiveRecord |
|
30 |
{ |
|
31 |
/** |
|
32 |
* {@inheritdoc} |
|
33 |
*/ |
|
34 |
public static function tableName() |
|
35 |
{ |
|
36 |
return '{{%printer_setting}}'; |
|
37 |
} |
|
38 |
|
|
39 |
/** |
|
40 |
* {@inheritdoc} |
|
41 |
*/ |
|
42 |
public function rules() |
|
43 |
{ |
|
44 |
return [ |
|
45 |
[['mall_id', 'printer_id', 'type', 'created_at', 'updated_at', 'deleted_at', 'show_type'], 'required'], |
|
46 |
[['mall_id', 'printer_id', 'block_id', 'is_attr', 'is_delete', 'status', 'mch_id', 'store_id', 'big'], 'integer'], |
|
47 |
[['type', 'show_type', 'order_send_type'], 'string'], |
|
48 |
[['order_send_type'], 'string', 'max' => 255], |
|
49 |
[['created_at', 'updated_at', 'deleted_at'], 'safe'], |
|
50 |
]; |
|
51 |
} |
|
52 |
|
|
53 |
/** |
|
54 |
* {@inheritdoc} |
|
55 |
*/ |
|
56 |
public function attributeLabels() |
|
57 |
{ |
|
58 |
return [ |
|
59 |
'id' => 'ID', |
|
60 |
'mall_id' => 'Mall ID', |
|
61 |
'mch_id' => 'Mch ID', |
|
62 |
'printer_id' => '打印机id', |
|
63 |
'block_id' => '模板id', |
|
64 |
'is_attr' => '0不使用规格 1使用规格', |
|
65 |
'big' => '倍数', |
|
66 |
'type' => '打印方式', |
|
67 |
'show_type' => '显示方式', |
|
68 |
'status' => '是否启用', |
|
69 |
'is_delete' => '删除', |
|
70 |
'order_send_type' => '订单发货方式', |
|
71 |
'created_at' => 'Created At', |
|
72 |
'updated_at' => 'Updated At', |
|
73 |
'deleted_at' => 'Deleted At', |
|
74 |
]; |
|
75 |
} |
|
76 |
|
|
77 |
public function getPrinter() |
|
78 |
{ |
|
79 |
return $this->hasOne(Printer::className(), ['id' => 'printer_id']); |
|
80 |
} |
|
81 |
|
|
82 |
public function getStore() |
|
83 |
{ |
|
84 |
return $this->hasOne(Store::className(), ['id' => 'store_id']); |
|
85 |
} |
|
86 |
} |