| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- namespace addons\BossWeight\common\models;
- use addons\Agent\common\models\AgentLevel;
- use addons\BossWeight\common\enums\LevelEnum;
- use common\enums\StatusEnum;
- use common\models\mall\MallAddons;
- use common\models\user\User;
- use Yii;
- use yii\db\Exception;
- /**
- * This is the model class for table "{{%addons_boss_weight_price}}".
- *
- * @property int $id
- * @property int $user_id 用户ID
- * @property int $level 股东等级
- * @property float $price 分红总金额
- * @property int $created_at 创建时间
- * @property int $updated_at 修改时间
- */
- class AddonsBossPrice extends \common\models\base\BaseActiveRecord
- {
- const ADDONS_NAME = 'BossWeight';
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_boss_weight_price}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['user_id', 'level','created_at', 'updated_at'], 'integer'],
- [['price'], 'number'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'user_id' => '用户ID',
- 'level' => '股东等级',
- 'price' => '分红总金额',
- 'created_at' => '创建时间',
- 'updated_at' => '修改时间',
- ];
- }
- public function getUser()
- {
- return $this->hasOne(User::class, ['id' => 'user_id'])->select('id,mobile,nickname,avatar_url,parent_id');
- }
- /**
- * @desc:关联股东等级
- * @Author: hua
- * @Date: 2021/11/5
- * @Time: 10:04
- * @Copyright: copyright (c) 2021 广东七件事集团
- * @return \yii\db\ActiveQuery
- */
- public function getBossLevel(){
- return $this->hasOne(AddonsBossLevel::class, ['level' => 'level'])->andWhere(['<>','status',StatusEnum::DELETE]);
- }
- }
|