hyperf-chat/app/Model/UsersEmoticon.php

55 lines
970 B
PHP
Raw Normal View History

2020-11-04 17:36:52 +08:00
<?php
declare (strict_types=1);
2020-11-14 18:10:28 +08:00
2020-11-04 17:36:52 +08:00
namespace App\Model;
/**
2020-11-14 18:10:28 +08:00
* 表情包收藏数据表模型
*
* @property int $id 收藏ID
* @property int $user_id 用户ID
* @property string $emoticon_ids 表情包ID多个用英文逗号拼接
*
* @package App\Model
2020-11-04 17:36:52 +08:00
*/
2020-11-05 17:40:51 +08:00
class UsersEmoticon extends BaseModel
2020-11-04 17:36:52 +08:00
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'users_emoticon';
/**
* The attributes that are mass assignable.
*
* @var array
*/
2020-11-14 18:10:28 +08:00
protected $fillable = [
'user_id',
'emoticon_ids'
];
2020-11-04 17:36:52 +08:00
/**
* The attributes that should be cast to native types.
*
* @var array
*/
2020-11-14 18:10:28 +08:00
protected $casts = [
'id' => 'integer',
'user_id' => 'integer'
];
2020-11-20 19:17:11 +08:00
/**
*
* @param string $value
* @return string
*/
public function getEmoticonIdsAttribute($value)
{
return explode(',', $value);
}
2020-11-04 17:36:52 +08:00
}