commit | author | age
|
90c639
|
1 |
<?php |
Z |
2 |
/** |
|
3 |
* Created by PhpStorm. |
|
4 |
* User: 风哀伤 |
|
5 |
* Date: 2019/4/1 |
|
6 |
* Time: 10:36 |
|
7 |
* @copyright: ©2019 浙江禾匠信息科技 |
|
8 |
* @link: http://www.zjhejiang.com |
|
9 |
*/ |
|
10 |
|
|
11 |
namespace app\forms; |
|
12 |
|
|
13 |
|
|
14 |
use app\models\Model; |
|
15 |
|
|
16 |
/** |
|
17 |
* @property integer $is_sms |
|
18 |
* @property integer $is_mail |
|
19 |
* @property integer $is_print |
|
20 |
* @property integer $is_share |
|
21 |
* @property integer $support_share |
|
22 |
* @property integer $is_member_price |
|
23 |
*/ |
|
24 |
class OrderConfig extends Model |
|
25 |
{ |
|
26 |
public $is_sms; |
|
27 |
public $is_print; |
|
28 |
public $is_mail; |
|
29 |
public $is_share; |
|
30 |
public $support_share; |
|
31 |
public $is_member_price; |
|
32 |
|
|
33 |
public function rules() |
|
34 |
{ |
|
35 |
return [ |
|
36 |
[['is_sms', 'is_print', 'is_mail', 'is_share', 'support_share'], 'default', 'value' => 0], |
|
37 |
[['is_sms', 'is_print', 'is_mail', 'is_share', 'support_share'], 'integer'], |
|
38 |
[['is_sms', 'is_print', 'is_mail', 'is_share', 'support_share'], 'in', 'range' => [0, 1]], |
|
39 |
]; |
|
40 |
} |
|
41 |
|
|
42 |
public function attributeLabels() |
|
43 |
{ |
|
44 |
return [ |
|
45 |
'is_sms' => '是否开启短信提醒', |
|
46 |
'is_print' => '是否开启小票打印', |
|
47 |
'is_mail' => '是否开启邮件通知', |
|
48 |
'is_share' => '是否开启分销', |
|
49 |
'support_share' => '是否支持分销', |
|
50 |
]; |
|
51 |
} |
|
52 |
|
|
53 |
public function __construct(array $config = []) |
|
54 |
{ |
|
55 |
parent::__construct($config); |
|
56 |
if (!$this->validate()) { |
|
57 |
\Yii::error('--order config --' . $this->getErrorMsg()); |
|
58 |
} |
|
59 |
} |
|
60 |
|
|
61 |
public function setOrder() |
|
62 |
{ |
|
63 |
$this->is_share = 1; |
|
64 |
$this->is_print = 1; |
|
65 |
$this->is_sms = 1; |
|
66 |
$this->is_mail = 1; |
|
67 |
$this->support_share = 1; |
|
68 |
} |
|
69 |
} |