hyperf-chat/app/Model/UsersEmoticon.php

38 lines
710 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
* 表情包收藏数据表模型
*
2021-04-20 16:30:57 +08:00
* @property int $id 收藏ID
* @property int $user_id 用户ID
2020-11-14 18:10:28 +08:00
* @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
{
protected $table = 'users_emoticon';
2020-11-14 18:10:28 +08:00
protected $fillable = [
'user_id',
'emoticon_ids'
];
2020-11-04 17:36:52 +08:00
2020-11-14 18:10:28 +08:00
protected $casts = [
2021-04-20 16:30:57 +08:00
'id' => 'integer',
2020-11-14 18:10:28 +08:00
'user_id' => 'integer'
];
2020-11-20 19:17:11 +08:00
/**
2021-04-20 16:30:57 +08:00
* @param string $value
2020-11-20 19:17:11 +08:00
* @return string
*/
public function getEmoticonIdsAttribute($value)
{
return explode(',', $value);
}
2020-11-04 17:36:52 +08:00
}