| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- namespace addons\ShareRedpack\common\models;
- use common\models\user\User;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_share_redpack_record_log".
- *
- * @property int $id
- * @property int $mall_id
- * @property int $record_id share_redpack_record.id
- * @property int $user_id 发红包者的id
- * @property int $get_user_id 获取红包者的id
- * @property float $change_num 变动金额
- * @property string $change_type add 增 sub 减
- * @property string $source_table 来源表
- * @property int $source_table_id 操作来源业务id
- * @property int|null $status 状态,-1:失效,1:正常,2:冻结
- * @property string|null $desc 变动说明
- * @property int|null $created_at
- * @property int|null $updated_at
- */
- class ShareRedpackRecordLog extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_addons_share_redpack_record_log';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'record_id', 'user_id', 'get_user_id', 'change_num', 'change_type'], 'required'],
- [['mall_id', 'record_id', 'user_id', 'get_user_id', 'source_table_id', 'status', 'created_at', 'updated_at'], 'integer'],
- [['change_num'], 'number'],
- [['change_type'], 'string', 'max' => 10],
- [['source_table', 'desc'], 'string', 'max' => 255],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'record_id' => 'Record ID',
- 'user_id' => 'User ID',
- 'get_user_id' => 'Get User ID',
- 'change_num' => 'Change Num',
- 'change_type' => 'Change Type',
- 'source_table' => 'Source Table',
- 'source_table_id' => 'Source Table ID',
- 'status' => 'Status',
- 'desc' => 'Desc',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- ];
- }
- /**
- * 关联用户表
- */
- public function getUser()
- {
- return $this->hasOne(User::class,['id'=>'user_id'])->select('nickname,avatar_url,mobile,username,id,created_at');
- }
- }
|