| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- namespace addons\BusinessActivity\common\models;
- use common\models\order\Order;
- use common\models\user\User;
- use Yii;
- use yii\db\ActiveQuery;
- /**
- * This is the model class for table "qimall_addons_business_activity_order".
- *
- * @property int $id ID
- * @property int $created_at 创建时间
- * @property int $updated_at 更新时间
- * @property int $mall_id 所属商城
- * @property int $status 状态
- * @property int $activity_id 活动ID
- * @property int $order_id 订单ID
- * @property int $order_status 订单状态
- * @property int $user_id 用户ID
- * @property string $goods_ids 可以返佣的商品ID
- */
- class AddonsBusinessActivityOrderModel extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_addons_business_activity_order';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['created_at', 'updated_at', 'mall_id', 'status', 'activity_id', 'order_id', 'order_status', 'user_id'], 'integer'],
- [['goods_ids'], 'string']
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- 'mall_id' => 'Mall ID',
- 'status' => 'Status',
- 'activity_id' => 'Activity ID',
- 'order_id' => 'Order ID',
- 'order_status' => 'Order Status',
- 'user_id' => 'User ID',
- ];
- }
- /**
- * @return ActiveQuery
- */
- public function getActivity(): ActiveQuery
- {
- return $this->hasOne(AddonsBusinessActivityModel::class, ['id' => 'activity_id']);
- }
- /**
- * @return ActiveQuery
- */
- public function getOrder(): ActiveQuery
- {
- return $this->hasOne(Order::class, ['id' => 'order_id']);
- }
- /**
- * @return ActiveQuery
- */
- public function getUser(): ActiveQuery
- {
- return $this->hasOne(User::class, ['id' => 'user_id'])->select('id, mobile, avatar_url, nickname');
- }
- }
|