| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?php
- namespace addons\WechatVideoShop\common\models;
- use common\enums\StatusEnum;
- use common\models\order\Order;
- use common\models\user\User;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_wechat_video_shop_order".
- *
- * @property int $id
- * @property int $mall_id
- * @property int $status 状态[1启用 0禁用 -1删除]
- * @property int $created_at 创建时间
- * @property int $updated_at 更新事件
- * @property int $user_id 买家
- * @property int $order_id 本地订单ID
- * @property string $order_no 订单编号
- * @property int $third_order_id 第三方ORDERID
- * @property array $content 完整数据
- * @property int $third_order_status 第三方状态
- * @property int $shop_id 第三方状态
- * @property int $is_settle 第三方状态
- * @property int $settle_at 第三方状态
- * @property int $order_status 第三方状态
- * @property int $is_pay 第三方状态
- * @property int $parent_id 第三方状态
- */
- class WechatVideoShopOrder extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_addons_wechat_video_shop_order';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'status', 'created_at', 'updated_at', 'user_id', 'order_id', 'is_pay',
- 'third_order_id', 'third_order_status', 'shop_id', 'is_settle', 'settle_at', 'order_status', 'parent_id'], 'integer'],
- [['content'], 'required'],
- [['content'], 'safe'],
- [['order_no'], 'string', 'max' => 30],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'status' => 'Status',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- 'user_id' => 'User ID',
- 'order_id' => 'Order ID',
- 'order_no' => 'Order No',
- 'third_order_id' => 'Third Order ID',
- 'content' => 'Content',
- 'third_order_status' => 'Third Order Status',
- ];
- }
- /**
- * 获取订单
- * @return \yii\db\ActiveQuery
- */
- public function getOrder()
- {
- return $this->hasOne(Order::class, ['id' => 'order_id']);
- }
- public function getShop()
- {
- return $this->hasOne(WechatVideoShop::class, ['id' => 'shop_id']);
- }
- public function getUser()
- {
- return $this->hasOne(User::class, ['id' => 'user_id']);
- }
- /**
- * @return \yii\db\ActiveQuery
- */
- public function getSharer()
- {
- return $this->hasOne(WechatVideoShopSharer::class, ['user_id' => 'parent_id'])->where(['status' => StatusEnum::ENABLED]);
- }
- }
|