| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?php
- namespace addons\WechatVideoShop\common\models;
- use common\models\user\User;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_wechat_video_shop_sharer".
- *
- * @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 用户ID
- * @property int $shop_id 店铺ID
- * @property float $total_sales 累计销售额
- * @property float $total_commission 累计销售额
- * @property float $total_score 累计销售额
- * @property int $total_customers 累计客户数
- * @property int $invite_at 分销员接受邀请时间
- * @property int $bind_at 分销员/导购员绑定时间
- * @property int $sharer_type 分销员/导购员绑定时间
- * @property int $total_order 分销员/导购员绑定时间
- * @property int $level 分销员/导购员绑定时间
- * @property int $upgrade_level_at 分销员/导购员绑定时间
- * @property int $upgrade_status 分销员/导购员绑定时间
- * @property string $openid openid
- * @property string $unionid unionid
- * @property string $nickname unionid
- * @property User $user
- * @property WechatVideoShop $shop
- */
- class WechatVideoShopSharer extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_addons_wechat_video_shop_sharer';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'status', 'created_at', 'updated_at', 'user_id', 'shop_id', 'total_customers', 'invite_at',
- 'bind_at', 'sharer_type', 'total_order', 'level', 'upgrade_status', 'upgrade_level_at'], 'integer'],
- [['openid', 'unionid', 'nickname'], 'string', 'max' => 50],
- [['total_sales', 'total_commission', 'total_score'], 'number'],
- ];
- }
- /**
- * {@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',
- 'openid' => 'Openid',
- 'unionid' => 'Unionid',
- 'shop_id' => 'Shop ID',
- 'total_sales' => 'Total Sales',
- 'total_customers' => 'Total Customers',
- 'bind_at' => 'Bind At',
- 'invite_at' => 'Invite At',
- ];
- }
- public function getUser(){
- return $this->hasOne(User::class, ['id' => 'user_id'])->select('id, username, nickname, avatar_url, mobile');
- }
- public function getShop(){
- return $this->hasOne(WechatVideoShop::class, ['id' => 'shop_id']);
- }
- public function getLevel()
- {
- return $this->hasOne(WechatVideoShopLevel::class, ['level' => 'level']);
- }
- }
|