Ai_GirlFriend/xunifriend_RaeeC/application/common/model/IntimacyFriend.php

30 lines
791 B
PHP
Raw Permalink Normal View History

2026-01-31 19:15:41 +08:00
<?php
namespace app\common\model;
use think\Model;
class IntimacyFriend extends Model
{
protected $name = 'intimacy_friend';
protected $autoWriteTimestamp = 'int';
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $append = [
'createtime_text',
];
protected function getCreatetimeTextAttr($value, $data)
{
$value = $value ? $value : $data['createtime'];
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public static function getList($user_id,$friend_id,$day)
{
$list = self::where([
'user_id' => $user_id,
'friend_id' => $friend_id,
'day' => $day,
])->order('id', 'desc')->select();
return $list;
}
}