| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace addons\OperatingNote\common\models;
- use common\models\user\User;
- use Yii;
- /**
- * This is the model class for table "{{%addons_operating_note_reward_record}}".
- *
- * @property int $id
- * @property int $mall_id 商城id
- * @property int $user_id 用户id
- * @property int $note_content_id 获取奖励来源笔记id
- * @property int $note_cate_id 笔记分类id
- * @property int $reward_type 奖励类型(积分/余额)
- * @property int $reward_source 奖励来源 (阅读/分享)
- * @property string $reward_content 奖励信息
- * @property string $note_type 文章类型
- * @property int $status
- * @property int $created_at
- * @property int $updated_at
- */
- class AddonsOperatingNoteRewardRecord extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_operating_note_reward_record}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'user_id', 'note_content_id', 'note_cate_id', 'reward_type', 'reward_source'], 'required'],
- [['mall_id', 'user_id', 'note_content_id', 'note_cate_id', 'reward_type', 'reward_source', 'status', 'created_at', 'updated_at','note_type'], 'integer'],
- [['reward_content'], 'string', 'max' => 100],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => '商城id',
- 'user_id' => '用户id',
- 'note_content_id' => '获取奖励来源笔记id',
- 'note_cate_id' => '笔记分类id',
- 'reward_type' => '奖励类型(积分/余额)',
- 'reward_source' => '奖励来源 (阅读/分享)',
- 'reward_content' => '奖励信息',
- 'status' => 'Status',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- ];
- }
- public function getUser()
- {
- return $this->hasOne(User::class, ['id' => 'user_id'])->select('id,mobile,nickname,avatar_url,parent_id,username');
- }
- }
|