TimestampBehavior::class, 'value' => time() ] ]; } public static function tableName() { return '{{%adopt_order_info}}'; } public function rules() { return [ [['store_id', 'name', 'mobile',], 'required'], [['store_id', 'created_at', 'updated_at', 'is_delete', 'order_id', 'is_storage', 'pick_method', 'pick_time', 'is_mature', 'mature_time', 'is_sms_mature','is_sms_storage','is_sms_preserve', 'confirm_self_pick', 'confirm_self_pick_time', 'storage_time', 'harvest_weight', 'confirm_self_pick_book', 'confirm_self_pick_book_time', 'start_self_pick', 'start_self_pick_time', 'end_self_pick', 'end_self_pick_time', 'pick_treatment_method', 'pick_treatment_method_time'], 'integer'], [['name', 'mobile', 'other_pick_fee', 'preserve_fee', 'harvest_storage_pic_url', 'book_self_pick_date', 'book_self_pick_time'], 'string'], [['name', 'mobile'], 'string', 'max' => 255], ]; } public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => '商城id', 'name' => '认养人姓名', 'mobile' => '认养人手机号', 'order_id' => '关联订单id', 'is_storage' => '是否入库 0-否 1-是', 'pick_method' => '采摘方式 1-自采带走 2-代采 3-自采入库', 'pick_time' => '采摘时间', 'pick_treatment_method' => '采摘处理方式 0未处理 1-带走 2- 入库', 'pick_treatment_method_time' => '采摘处理时间', 'is_mature' => '是否成熟 0-否 1-是', 'mature_time' => '成熟时间', 'confirm_self_pick' => '确认自采完成', 'confirm_self_pick_time' => '确认自采完成时间', 'created_at' => '创建时间', 'updated_at' => '更新时间', 'is_delete' => 'Is Delete', 'other_pick_fee' => '代采费用', 'preserve_fee' => '保管费用', 'is_sms_mature' => '未选择采摘超时提醒短信', 'is_sms_storage' => '未选择保管超时提醒短信', 'is_sms_free_preserve' => '免费保管提醒短信', 'harvest_storage_pic_url' => '收获入库图片', 'storage_time' => '收获入库时间', 'harvest_weight' => '收获入库重量', 'book_self_pick_date' => '预约自采日期', 'book_self_pick_time' => '预约自采时间', 'confirm_self_pick_book' => '确认自采预约', 'confirm_self_pick_book_time' => '确认自采预约时间', 'start_self_pick' => '开始自采', 'start_self_pick_time' => '开始自采时间', 'end_self_pick' => '结束自采', 'end_self_pick_time' => '结束自采时间', ]; } public function afterSave($insert, $changedAttributes) { parent::afterSave($insert, $changedAttributes); if(isset($changedAttributes['is_mature']) && $this->is_mature == AdoptOrderInfo::ORDER_FLOW_MATURE){ (new \app\utils\OrderUtil())->AdoptOrderMature($this); } if(isset($changedAttributes['is_mature']) && $this->is_mature == AdoptOrderInfo::ORDER_FLOW_MATURE){ (new \app\utils\OrderUtil())->AdoptOrderMatureTips($this); } if(isset($changedAttributes['is_storage']) && $this->is_storage == AdoptOrderInfo::ORDER_FLOW_STORAGE){ (new \app\utils\OrderUtil())->AdoptOrderStorage($this); } if(isset($changedAttributes['is_storage']) && $this->is_storage == AdoptOrderInfo::ORDER_FLOW_STORAGE){ (new \app\utils\OrderUtil())->AdoptOrderStorageTips($this); } if(isset($changedAttributes['is_preserve']) && $this->is_preserve == AdoptOrderInfo::ORDER_FLOW_PRESERVE){ (new \app\utils\OrderUtil())->AdoptOrderBillingStart($this); } if(isset($changedAttributes['is_preserve']) && $this->is_preserve == AdoptOrderInfo::ORDER_FLOW_PRESERVE){ (new \app\utils\OrderUtil())->AdoptOrderBillingTips($this); } } }