Metrics
0
Watch 60 Star 145 Fork 67

暗夜在火星 / PhalApi-LibraryPHP

Sign up for free
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
PhalApi扩展类库,期待您的开源!新增的扩展类库,可通过Pull Request方式提交,管理员会以最快速度进行合并。 spread retract

https://www.phalapi.net/

Clone or download
User.php 746 Bytes
Copy Edit Web IDE Raw Blame History
暗夜在火星 authored 2015-04-12 13:35 . user
<?php
class Model_User_User extends PhalApi_Model_NotORM {
protected function getTableName($id) {
return 'user';
}
public function getInfo($userId) {
return $this->getORM()->select('*')->where('id = ?', $userId)->fetch();
}
/**
* 批量获取用户快照,并进行反转,以便外部查找
*/
public function getSnapshotByUserIds(array $userIds)
{
$rs = array();
if (empty($userIds)) {
return $rs;
}
$rows =self::getORM()
->select('id,nickname,avatar')
->where('id', $userIds)
->fetchAll();
foreach ($rows as $row) {
$rs[$row['id']] = $row;
}
return $rows;
}
}

Comment ( 0 )

You need to Sign in for post a comment

Help Search

Gitee_sixth 5th_float_left_close