255], [['address', 'remark'], 'string', 'max' => 1000], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => 'Store ID', 'user_id' => 'User ID', 'order_no' => 'Order No', 'total_price' => 'Total Price', 'pay_price' => 'Pay Price', 'express_price' => 'Express Price', 'name' => 'Name', 'mobile' => 'Mobile', 'address' => 'Address', 'remark' => 'Remark', 'is_pay' => 'Is Pay', 'pay_type' => 'Pay Type', 'pay_time' => 'Pay Time', 'is_send' => 'Is Send', 'send_time' => 'Send Time', 'express' => 'Express', 'express_no' => 'Express No', 'is_confirm' => 'Is Confirm', 'confirm_time' => 'Confirm Time', 'is_comment' => 'Is Comment', 'apply_delete' => 'Apply Delete', 'addtime' => 'Addtime', 'is_delete' => 'Is Delete', 'address_data' => 'Address Data', 'is_offline' => 'Is Offline', 'clerk_id' => 'Clerk ID', 'is_cancel' => 'Is Cancel', 'offline_qrcode' => 'Offline Qrcode', 'shop_id' => 'Shop ID', 'is_sale' => 'Is Sale', 'version' => 'Version', 'mch_id' => 'Mch ID', 'integral' => 'Integral', 'goods_id' => 'goods_id', 'words' => 'words', 'is_recycle' => '是否加入回收站 0--不加入 1--加入', 'is_show' => '是否显示 0--不显示 1--显示(软删除)', ]; } public function getUser() { return $this->hasOne(User::className(), ['id'=>'user_id']); } public function getDetail() { return $this->hasOne(IntegralOrderDetail::className(), ['order_id'=>'id']); } public function getShop() { return $this->hasOne(Shop::className(), ['id'=>'shop_id']); } public function getClerk() { return $this->hasOne(User::className(), ['id'=>'clerk_id']); } public function afterSave($insert, $changedAttributes) { $data = $insert ? json_encode($this->attributes) : json_encode($changedAttributes); CommonActionLog::storeActionLog('', $insert, $this->is_delete, $data, $this->id); } public function getOrderDetail() { return $this->hasMany(IntegralOrderDetail::className(), ['order_id'=>'id'])->alias('od') ->leftJoin(['g'=>IntegralGoods::tableName()], 'g.id=goods_id')->select(['od.*','g.name','g.attr goods_attr']); } public static function find() { return Yii::createObject(MyActiveQuery::className(), [ get_called_class(), [ 'myCondition' => [ 'is_show' => 1, 'is_recycle'=>0 ] ] ]); } }