0], [['is_sms', 'is_print', 'is_mail', 'is_share', 'support_share'], 'integer'], [['is_sms', 'is_print', 'is_mail', 'is_share', 'support_share'], 'in', 'range' => [0, 1]], ]; } public function attributeLabels() { return [ 'is_sms' => '是否开启短信提醒', 'is_print' => '是否开启小票打印', 'is_mail' => '是否开启邮件通知', 'is_share' => '是否开启分销', 'support_share' => '是否支持分销', ]; } public function __construct(array $config = []) { parent::__construct($config); if (!$this->validate()) { \Yii::error('--order config --' . $this->getErrorMsg()); } } public function setOrder() { $this->is_share = 1; $this->is_print = 1; $this->is_sms = 1; $this->is_mail = 1; $this->support_share = 1; } }