hyperf-chat/app/Model/Emoticon/UsersEmoticon.php

39 lines
714 B
PHP
Raw Permalink Normal View History

2020-11-04 17:36:52 +08:00
<?php
declare (strict_types=1);
2020-11-14 18:10:28 +08:00
2022-01-20 21:20:58 +08:00
namespace App\Model\Emoticon;
use App\Model\BaseModel;
2020-11-04 17:36:52 +08:00
/**
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 = [
'user_id' => 'integer'
];
2020-11-20 19:17:11 +08:00
/**
2021-07-10 00:18:40 +08:00
* @param $value
* @return false|string[]
2020-11-20 19:17:11 +08:00
*/
public function getEmoticonIdsAttribute($value)
{
return explode(',', $value);
}
2020-11-04 17:36:52 +08:00
}