30], [['title', 'duty_paragraph', 'opening_bank'], 'string', 'max' => 200], [['opening_bank_account'], 'string', 'max' => 100], [['address', 'remark', 'explain'], 'string', 'max' => 255], [['phone'], 'string', 'max' => 50], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'merchant_id' => '商户id', 'store_id' => '店铺ID', 'member_id' => '用户ID', 'order_id' => '订单ID', 'order_sn' => '订单编号', 'title' => '公司抬头', 'duty_paragraph' => '公司税号', 'opening_bank' => '公司开户行', 'opening_bank_account' => '公司开户行账号', 'address' => '公司地址', 'phone' => '公司电话', 'remark' => '备注', 'explain' => '说明', 'type' => '类型', // 1 企业 2 个人 'tax_money' => '税费', 'audit_status' => '开具状态', 'audit_time' => '开具时间', 'status' => '状态', 'created_at' => '创建时间', 'updated_at' => '修改时间', ]; } /** * 关联订单 * * @return \yii\db\ActiveQuery */ public function getOrder() { return $this->hasOne(Order::class, ['id' => 'order_id']); } /** * @param $insert * @return bool */ public function beforeSave($insert) { if ($this->audit_status == AuditStatusEnum::ENABLED && $this->oldAttributes['audit_status'] != AuditStatusEnum::ENABLED) { $this->audit_time = time(); } return parent::beforeSave($insert); } }