src/Biz/User/Dao/Impl/FriendDaoImpl.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace Biz\User\Dao\Impl;
use Biz\User\Dao\FriendDao;
use Codeages\Biz\Framework\Dao\GeneralDaoImpl;
class FriendDaoImpl extends GeneralDaoImpl implements FriendDao
{
protected $table = 'friend';
public function updateByFromIdAndToId($fromId, $toId, $fields)
{
return $this->db()->update($this->table, $fields, array('fromId' => $fromId, 'toId' => $toId));
}
public function getByFromIdAndToId($fromId, $toId)
{
return $this->getByFields(array('fromId' => $fromId, 'toId' => $toId));
}
public function searchByFromId($fromId, $start, $limit)
{
return $this->search(array('fromId' => $fromId), array('createdTime' => 'DESC'), $start, $limit);
}
public function findFollowingsByFromId($fromId)
{
$sql = "SELECT * FROM {$this->table} WHERE fromId = ? ORDER BY createdTime DESC ";
return $this->db()->fetchAll($sql, array($fromId));
}
public function findFollowersByToId($toId)
{
$sql = "SELECT * FROM {$this->table} WHERE toId = ? ORDER BY createdTime DESC ";
return $this->db()->fetchAll($sql, array($toId));
}
public function searchByToId($toId, $start, $limit)
{
return $this->search(array('toId' => $toId), array('createdTime' => 'DESC'), $start, $limit);
}
public function findByFromIdAndToIds($fromId, array $toIds)
{
if (empty($toIds)) {
return array();
}
$toIds = array_values($toIds);
$marks = str_repeat('?,', count($toIds) - 1).'?';
$parmaters = array_merge(array($fromId), $toIds);
$sql = "SELECT * FROM {$this->table} WHERE fromId = ? AND toId IN ({$marks});";
return $this->db()->fetchAll($sql, $parmaters);
}
public function searchByUserId($userId, $start, $limit)
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。