本文整理汇总了PHP中CommonUtil类的典型用法代码示例。如果您正苦于以下问题:PHP CommonUtil类的具体用法?PHP CommonUtil怎么用?PHP CommonUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CommonUtil类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: create_hongbao_xml
function create_hongbao_xml($retcode = 0, $reterrmsg = "ok")
{
try {
$this->setParameter('sign', $this->get_sign());
$commonUtil = new CommonUtil();
return $commonUtil->arrayToXml($this->parameters);
} catch (SDKRuntimeException $e) {
die($e->errorMessage());
}
}
开发者ID:jasonhzy,项目名称:wxhb,代码行数:10,代码来源:WxXianjinHelper.php
示例2: addAction
/**
* 添加焦点图
*/
function addAction()
{
if ($this->isPost()) {
$text = FRequest::getPostString('text');
$pic = FRequest::getPostString('pic');
$url = FRequest::getPostString('url');
$title = FRequest::getPostString('title');
$position = CommonUtil::getComParam(FRequest::getPostInt('position'), 0);
if (!$pic) {
$this->showMessage("图片不能为空", error);
return;
}
if (!$title) {
$this->showMessage("标题不能为空", error);
return;
}
//打开网页
//print_r($content);
$data2 = array('title' => $title, 'text' => $text, 'pic' => $pic, 'url' => $url, 'position' => $position);
$mumu_youxi_table = new FTable("mumu_youxi");
$mumu_youxi_table->insert($data2);
$this->showMessage("添加成功", "success", "/MumuYouxi/list");
return;
}
$this->display('admin/mumu_youxi_add');
}
开发者ID:jiatower,项目名称:php,代码行数:29,代码来源:MumuYouxi.php
示例3: listAction
/**
* 活动列表
*/
function listAction()
{
//global $_F;
// $_F["debug"] = true;
$page = max(1, FRequest::getInt('page'));
$title = FRequest::getString('title');
$where = array();
$shanchu_id = FRequest::getInt('shanchu_id');
if ($shanchu_id) {
$events = new FTable('events');
$events->where(array('id' => $shanchu_id))->remove(true);
}
if ($title) {
$where["title"] = array('like' => $title);
}
$table = new FTable("events");
$events = $table->fields(array("id", "style", "title", "pic", "content", "tm"))->where($where)->page($page)->limit(20)->order(array("id" => "desc"))->select();
foreach ($events as &$event) {
$event["pic"] = CommonUtil::getMoreSizeImg($event["pic"], 100, 100);
$event["content"] = json_decode($event["content"]);
}
$page_info = $table->getPagerInfo();
$this->assign('page_info', $page_info);
$this->assign('events', $events);
$this->assign('title', $title);
$this->display('admin/events_list');
}
开发者ID:jiatower,项目名称:php,代码行数:30,代码来源:EventsList.php
示例4: createRefundOrder
public function createRefundOrder($fields)
{
$account = AccountBiz::getInstance()->getOrCreateAccount($fields['user_id'], $fields['channel']);
$refund = new RefundModel();
$refund->id = CommonUtil::longId();
$refund->user_id = $fields['user_id'];
$refund->account_id = $account['id'];
$refund->channel = $fields['channel'];
$refund->gateway = $fields['gateway'];
$refund->recharge_id = $fields['recharge_id'];
$refund->mer_refund_no = $refund->id . substr(sprintf('%012s', $fields['user_id']), -12);
if (null !== ($localEnv = \GlobalConfig::getLocalEnv())) {
$refund->mer_refund_no = substr($refund->mer_refund_no, 0, -strlen($localEnv)) . $localEnv;
}
$refund->amount = $fields['refund_amount'];
$refund->create_time = time();
$refund->callback_url = $fields['callback_url'];
$refund->subject = $fields['subject'];
$refund->body = isset($fields['body']) ? $fields['body'] : '';
$refund->busi_refund_no = isset($fields['busi_refund_no']) ? $fields['busi_refund_no'] : '';
$refund->seller_partner = isset($fields['seller_partner']) ? $fields['seller_partner'] : '';
if (true !== $refund->save()) {
throw new PayException(ErrCode::ERR_ORDER_CREATE_FAIL);
}
return $refund;
}
开发者ID:yellowriver,项目名称:pay,代码行数:26,代码来源:RefundBiz.class.php
示例5: excecuteCommand
public static function excecuteCommand($facade, $data)
{
$jsonstr = '';
try {
if ($data->btn_action == 'save') {
$jsonstr = CommonUtil::getSuccessFailureJson($facade->create($data));
} else {
if ($data->btn_action == 'update') {
$jsonstr = CommonUtil::getSuccessFailureJson($facade->update($data));
} else {
if ($data->btn_action == 'delete') {
$jsonstr = CommonUtil::getSuccessFailureJson($facade->delete($data));
} else {
if ($data->btn_action == 'getAll') {
$jsonstr = $facade->getAll();
} else {
$jsonstr = '{"message":"action not found"}';
}
}
}
}
} catch (Exception $e) {
$jsonstr = CommonUtil::getExceptionMessage($e);
}
return $jsonstr;
}
开发者ID:vijay8090,项目名称:numeracy,代码行数:26,代码来源:CommonUtil.php
示例6: listAction
function listAction()
{
//global $_F;
//$_F["debug"] = true;
$page = max(1, FRequest::getInt('page'));
$uid = FRequest::getInt('uid');
$nickname = FRequest::getString('nickname');
$where = array('ub.count' => array('gte' => '1'), 'um.stat' => '0', 'ud.uid' => array('gte' => '5000000'));
if ($uid > 0) {
$where["ud.uid"] = $uid;
}
if ($nickname) {
$where["ud.nickname"] = array('like' => $nickname);
}
$table = new FTable("user_ban", "ub");
$users = $table->fields(array("um.uid", "um.stat", "um.gender", "um.reg_time", "ud.nickname", "ud.avatar", "ud.province", "ud.city", "ud.age", "ud.height", "ud.marry", "ud.aboutme", "ub.count"))->leftJoin("user_detail", "ud", "ub.uid=ud.uid")->leftJoin("user_main", "um", "ub.uid=um.uid")->where($where)->page($page)->limit(10)->order(array("ub.count" => "desc"))->select();
foreach ($users as &$user) {
$marry_id = $user["marry"];
$user["marry"] = self::$MARRY[$marry_id];
$user["avatar"] = CommonUtil::getMoreSizeImg($user["avatar"], 50, 50);
}
$page_info = $table->getPagerInfo();
$this->assign('page_info', $page_info);
$this->assign('users', $users);
$this->assign('uid', $uid);
$this->assign('nickname', $nickname);
$this->display('admin/userreport_list');
}
开发者ID:jiatower,项目名称:php,代码行数:28,代码来源:UserReport.php
示例7: listAction
function listAction()
{
//global $_F;
// $_F["debug"] = true;
$page = max(1, FRequest::getInt('page'));
$uid = FRequest::getInt('uid');
$query_str = " ( mm.type='pic' or mm.type='text' ) ";
$where = array();
if ($uid > 0) {
$where["mm.from"] = $uid;
//$query_str=$query_str." and (mm.from='$uid' or mm.to='$uid') and mm.from<>1 and mm.to<>1 ";
$where["str"] = $query_str;
$user_detail_table = new FTable("user_detail");
$user_detail = $user_detail_table->where(array('uid' => $uid))->find();
$user_avatar = CommonUtil::getMoreSizeImg($user_detail["avatar"], 100, 100);
$table = new FTable("message", "mm", FDB::$DB_MUMU_MESSAGE);
$user_messages = $table->fields(array("mm.tm", "mm.from", "mm.to", "mm.content"))->where($where)->groupBy("mm.to")->page($page)->limit(20)->order(array("mm.tm" => "desc"))->select();
$user_messages1 = $table->fields(array("mm.tm", "mm.from", "mm.to", "mm.content"))->where($where)->groupBy("mm.to")->order(array("mm.tm" => "desc"))->select();
$total = count($user_messages1);
foreach ($user_messages as &$user_message) {
$user_detail_table = new FTable("user_detail");
$user_detail = $user_detail_table->where(array('uid' => $user_message["to"]))->find();
$user_message["to_avatar"] = CommonUtil::getMoreSizeImg($user_detail["avatar"], 100, 100);
$user_message["content"] = json_decode($user_message["content"]);
}
}
if ($uid > 0) {
$page_info = $table->getPagerInfo();
$this->assign('page_info', FPager::getPagerInfo($total, $page, '20'));
$this->assign('user_messages', $user_messages);
$this->assign('user_avatar', $user_avatar);
}
$this->assign('uid', $uid);
$this->display('admin/usermessage_list');
}
开发者ID:jiatower,项目名称:php,代码行数:35,代码来源:UserMessage.php
示例8: listAction
function listAction()
{
//global $_F;
// $_F["debug"] = true;
$page = max(1, FRequest::getInt('page'));
$uid = FRequest::getInt('uid');
$where = array('tp.status' => '1');
if ($uid > 0) {
$where["ud.uid"] = $uid;
} else {
$where["1"] = 0;
}
$table = new FTable("topic", "tp");
$topics = $table->fields(array("tp.id", "tp.uid", "tp.title", "tp.pics", "ud.nickname", "tp.picslevel"))->leftJoin("user_detail", "ud", "tp.uid=ud.uid")->where($where)->page($page)->limit(20)->order(array("tp.id" => "desc"))->select();
foreach ($topics as &$topic) {
$topic_tupian = explode(",", $topic['pics']);
$pics = "";
foreach ($topic_tupian as $topic_pics) {
if ($topic_pics) {
$pics = $pics . CommonUtil::getMoreSizeImg($topic_pics, 100, 100) . ",";
}
}
$topic["pics"] = $pics;
$discovery_table = new FTable("discovery", "mmd", FDB::$DB_MUMU_SORT);
$discovery = $discovery_table->where(array('tid' => $topic["id"]))->find();
$topic["priority"] = $discovery["priority"];
}
$page_info = $table->getPagerInfo();
$this->assign('page_info', $page_info);
$this->assign('topics', $topics);
$this->assign('uid', $uid);
$this->display('admin/user_topic_zhiding_list');
}
开发者ID:jiatower,项目名称:php,代码行数:33,代码来源:TopicZhiding.php
示例9: listAction
function listAction()
{
//global $_F;
//$_F["debug"] = true;
$page = max(1, FRequest::getInt('page'));
$uid = FRequest::getInt('uid');
$nickname = FRequest::getString('nickname');
$gender = FRequest::getInt('gender');
$where = array();
if ($uid || $nickname) {
if ($uid) {
$where["ud.uid"] = $uid;
}
if ($nickname) {
$where["ud.nickname"] = array('like' => $nickname);
}
} else {
$where["um.stat"] = '0';
$where["ud.avatarlevel"] = '-2';
$where["ud.uid"] = array('gte' => '5000000');
}
if ($gender) {
$where["um.gender"] = $gender;
}
$table = new FTable("user_detail", "ud");
$users = $table->fields(array("ud.uid", "um.gender", "ud.nickname", "ud.avatar", "ud.avatarlevel"))->leftJoin("user_main", "um", "ud.uid=um.uid")->where($where)->page($page)->limit(50)->order(array("ud.uid" => "asc"))->select();
foreach ($users as &$user) {
$uid_d = $user["uid"];
$table2 = new FTable("image_md5", "im");
$image_md5 = $table2->fields(array("im.md5"))->where(array("im.url" => $user["avatar"]))->find();
// echo($user["avatar"]);
$table3 = new FTable("image_md5", "im");
$images = $table3->fields(array("im.url"))->where(array("im.md5" => $image_md5["md5"], "str" => " im.url<>'" . $user["avatar"] . "' ", "im.type" => "avatar"))->select();
$i = 1;
foreach ($images as $image) {
$i++;
$table4 = new FTable("user_detail", "ud");
$users4 = $table4->fields(array("ud.uid"))->where(array("ud.avatar" => $image['url']))->find();
if ($users4) {
$uid_d = $uid_d . "," . $users4['uid'];
}
}
$user["uid_d"] = $uid_d;
$user["uid_i"] = $i;
$user["avatar"] = CommonUtil::getMoreSizeImg($user["avatar"], 222, 222);
}
$page_info = $table->getPagerInfo();
$this->assign('page_info', $page_info);
$this->assign('users', $users);
$this->assign('uid', $uid);
$this->assign('nickname', $nickname);
$this->assign('gender', $gender);
$this->display('admin/user_avatar_list');
}
开发者ID:jiatower,项目名称:php,代码行数:54,代码来源:UserAvatar.php
示例10: createForUser
/**
* @param $user User
* @param $sessionOnly boolean
* @param null $expireDate int
* @return UserSession
*/
public static function createForUser($user, $expireDate)
{
$session = new UserSession();
$session->user = $user->id;
$session->token = Auth::generateSessionToken($user->salt);
$session->createDate = Database::now();
$session->expireDate = CommonUtil::sqlTimeStamp($expireDate);
$session->expired = 0;
$session->save();
return $session;
}
开发者ID:pvpalvk,项目名称:kyberkoulutus2,代码行数:17,代码来源:UserSession.php
示例11: list2Action
function list2Action()
{
//global $_F;
//$_F["debug"] = true;
$page = max(1, FRequest::getInt('page'));
$uid = FRequest::getInt('uid');
$nickname = FRequest::getString('nickname');
$gender = FRequest::getInt('gender');
$where = array();
$query_str = " im.status = '1' ";
$table = new FTable("image_md5", "im");
$images = $table->fields(array("im.url", "im.status", "im.type"))->where(array('str' => $query_str))->page($page)->limit(50)->order(array("im.tm" => "asc"))->select();
foreach ($images as &$image) {
//头像
if ($image['type'] == "avatar") {
$table2 = new FTable("user_detail", "ud");
$users = $table2->fields(array("ud.uid"))->where(array("ud.avatar" => $image['url']))->find();
$image["uid"] = $users['uid'];
$image["type_w"] = "头像";
}
//大头像
if ($image['type'] == "avatar_big") {
$image["type_w"] = "大头像";
}
//相册
if ($image['type'] == "photo") {
$table2 = new FTable("user_photo_album", "upa");
$users = $table2->fields(array("upa.uid"))->where(array("upa.pic" => $image['url']))->find();
$image["uid"] = $users['uid'];
$image["type_w"] = "相册";
}
//聊天
if ($image['type'] == "chat") {
$table2 = new FTable("bad_message", "bm", FDB::$DB_MUMU_MESSAGE);
$users = $table2->fields(array("bm.from"))->where(array("bm.origin" => $image['url']))->find();
$image["uid"] = $users['from'];
$image["type_w"] = "聊天";
}
//视屏认证
if ($image['type'] == "video_certify") {
$table2 = new FTable("video_record", "vr");
$users = $table2->fields(array("vr.uid"))->where(array("vr.video_img" => $image['url']))->find();
$image["uid"] = $users['uid'];
$image["type_w"] = "视屏认证";
}
$image["url_xiao"] = CommonUtil::getMoreSizeImg($image["url"], 111, 111);
}
$page_info = $table->getPagerInfo();
$this->assign('page_info', $page_info);
$this->assign('images', $images);
$this->display('admin/user_image_list2');
}
开发者ID:jiatower,项目名称:php,代码行数:52,代码来源:UserImage.php
示例12: defaultAction
public function defaultAction()
{
//global $_F;
//$_F["debug"] = true;
$table = new FTable("mumu_youxi");
$mumu_youxis = $table->fields(array("id", "title", "text", "pic", "url", "position"))->limit(20)->order(array("position" => "asc", "id" => "desc"))->select();
foreach ($mumu_youxis as &$mumu_youxi) {
$mumu_youxi["pic"] = CommonUtil::getMoreSizeImg($mumu_youxi["pic"], 280, 280);
$mumu_youxi["text"] = mb_substr($mumu_youxi["text"], 0, 50, "utf-8");
}
$this->assign('mumu_youxi', $mumu_youxis);
$this->assign('title', '慕慕游戏');
$this->display('mumu_youxi');
}
开发者ID:jiatower,项目名称:php,代码行数:14,代码来源:MumuYouxi.php
示例13: defaultAction
public function defaultAction()
{
//global $_F;
//$_F["debug"] = true;
$table = new FTable("weixin_huodong");
$weixin_huodongs = $table->fields(array("id", "title", "text", "pic", "url", "position"))->limit(20)->order(array("position" => "asc", "id" => "desc"))->select();
foreach ($weixin_huodongs as &$weixin_huodong) {
$weixin_huodong["pic"] = CommonUtil::getMoreSizeImg($weixin_huodong["pic"], 280, 280);
$weixin_huodong["text"] = mb_substr($weixin_huodong["text"], 0, 50, "utf-8");
}
$this->assign('weixin_huodong', $weixin_huodongs);
$this->assign('title', '微信活动-慕慕');
$this->display('weixin_huodong');
}
开发者ID:jiatower,项目名称:php,代码行数:14,代码来源:WeixinHuodong.php
示例14: getCityId
public static function getCityId($location)
{
if (is_object($location)) {
$location = CommonUtil::object2array($location);
}
if (!is_array($location)) {
return 0;
}
if ($location['cid']) {
$cityId = $location["cid"];
} else {
$cityId = $location["pid"];
}
return $cityId;
}
开发者ID:hzh123,项目名称:my_yaf,代码行数:15,代码来源:Common.php
示例15: listAction
function listAction()
{
//global $_F;
// $_F["debug"] = true;
$page = max(1, FRequest::getInt('page'));
$uid = FRequest::getInt('uid');
$tiaojian = FRequest::getString('tiaojian');
$where = array('tp.picslevel' => array('gte' => '3'), 'tp.uid' => array('gte' => '5000000'), 'tp.status' => '1');
if ($uid > 0) {
$where["tp.uid"] = $uid;
}
$datetime_riqi = date("Y-m-d", time());
$datetime_riqi_zuotian = date("Y-m-d", time() - 86400);
$datetime_riqi_qiantian = date("Y-m-d", time() - 172800);
if ($tiaojian == "dangri") {
$query_str = " tp.tm >= '" . $datetime_riqi . " 00:00:00' ";
$where["str"] = $query_str;
}
if ($tiaojian == "zuori") {
$query_str = " tp.tm >= '" . $datetime_riqi_zuotian . " 00:00:00' and tp.tm < '" . $datetime_riqi . " 00:00:00' ";
$where["str"] = $query_str;
}
if ($tiaojian == "qianri") {
$query_str = " tp.tm >= '" . $datetime_riqi_qiantian . " 00:00:00' and tp.tm < '" . $datetime_riqi_zuotian . " 00:00:00' ";
$where["str"] = $query_str;
}
if ($tiaojian == "fengsuo") {
$where["tp.status"] = '2';
} else {
$where["tp.status"] = '1';
}
$table = new FTable("topic", "tp");
$topics = $table->fields(array("tp.id", "tp.uid", "tp.status", "um.gender", "tp.title", "tp.pics", "tp.tm", "ud.nickname", "ud.province", "ud.city", "tp.picslevel"))->leftJoin("user_detail", "ud", "tp.uid=ud.uid")->leftJoin("user_main", "um", "tp.uid=um.uid")->where($where)->page($page)->limit(20)->order(array("tp.id" => "desc"))->select();
foreach ($topics as &$topic) {
$topic_tupian = explode(",", $topic['pics']);
$pics = "";
foreach ($topic_tupian as $topic_pics) {
if ($topic_pics) {
$pics = $pics . CommonUtil::getMoreSizeImg($topic_pics, 100, 100) . ",";
}
}
$topic["pics"] = $pics;
}
$page_info = $table->getPagerInfo();
$this->assign('page_info', $page_info);
$this->assign('topics', $topics);
$this->display('admin/user_topicpics_list');
}
开发者ID:jiatower,项目名称:php,代码行数:48,代码来源:TopicPics.php
示例16: index
/**
* 运行socket服务端
*/
public function index()
{
require 'socketConfig.php';
if (!CommonUtil::add_lock('lock')) {
//用于判断是否已经开启
die('Running');
}
//设置超时时间
ignore_user_abort(true);
set_time_limit(0);
//修改内存
ini_set('memory_limit', WEBSOCKET_MEMORY);
$webSocket = new SocketService();
$webSocket->run();
echo socket_strerror($webSocket->error());
}
开发者ID:blakeFez,项目名称:blakeFez-chatRoom,代码行数:19,代码来源:SocketCommand.php
示例17: filterSiteAccess
public function filterSiteAccess($filterChain)
{
$actionId = $this->getAction()->getId();
if ($actionId != 'login' && $actionId != 'captcha' && $actionId != 'test' && (Yii::app()->user->isGuest || CommonUtil::getUserStatus(Yii::app()->user->signid) != 0)) {
if ($actionId == 'refreshJson') {
$this->layout = false;
header('Content-type: application/json');
echo "this.location.href='/main/login.do'";
Yii::app()->end();
}
$this->redirect("/main/login.do");
}
date_default_timezone_set("PRC");
$this->term = CommonUtil::getCachedTerm();
//$auth=Yii::app()->authManager;
//if($auth->getRoles(Yii::app()->user->id))
$filterChain->run();
}
开发者ID:haokuweb,项目名称:myDemo,代码行数:18,代码来源:Controller.php
示例18: listAction
/**
* 列表
*/
function listAction()
{
// global $_F;
// $_F["debug"] = true;
$page = max(1, FRequest::getInt('page'));
$where = array();
$shanchu_id = FRequest::getInt('shanchu_id');
if ($shanchu_id) {
$mumu_bas = new FTable('mumu_ba');
$mumu_bas->where(array('id' => $shanchu_id))->remove(true);
}
$table = new FTable("mumu_ba");
$mumu_bas = $table->fields(array("id", "title", "text", "pic", "riqi", "position"))->where($where)->page($page)->limit(20)->order(array("id" => "desc"))->select();
foreach ($mumu_bas as &$mumu_ba) {
$mumu_ba["pic"] = CommonUtil::getMoreSizeImg($mumu_ba["pic"], 100, 100);
}
$page_info = $table->getPagerInfo();
$this->assign('page_info', $page_info);
$this->assign('mumu_ba', $mumu_bas);
$this->display('admin/mumu_ba_list');
}
开发者ID:jiatower,项目名称:php,代码行数:24,代码来源:MumuBa.php
示例19: defaultAction
public function defaultAction()
{
//global $_F;
//$_F["debug"] = true;
$table = new FTable("mumu_ba");
$mumu_bas = $table->fields(array("id", "title", "text", "pic", "riqi", "position"))->limit(20)->order(array("position" => "asc", "id" => "desc"))->select();
$domList = array();
foreach ($mumu_bas as &$mumu_ba) {
$riqi = explode("-", $mumu_ba["riqi"]);
$mumu_ba["pic"] = CommonUtil::getMoreSizeImg($mumu_ba["pic"], 400, 450);
$mumu_ba["riqi_nian"] = $riqi[0];
$mumu_ba["riqi_yue"] = $riqi[1];
$mumu_ba["riqi_ri"] = $riqi[2];
$sub_arr = array("height" => "100%", "width" => "100%", "content" => '<div><div style="line-height:30px; text-align:left; padding-left: 20px; font-size: 18px; font-weight: bold;">' . $mumu_ba["title"] . '</div><div style=" text-align:center;"><img src="' . $mumu_ba["pic"] . '"></div><div style="height:100px;overflow: hidden;"><div style="float:left; width:100px; margin-right:10px;"><div style=" line-height:45px;font-size:36px; font-weight:bold; color:#0099FF; text-align:center;">' . $riqi[2] . '</div><div style="line-height:25px; text-align:center;">' . self::NumChinese(intval($riqi[1])) . ' ' . $riqi[0] . '</div></div><div style="line-height:25px;overflow: hidden; padding-right: 15px;">' . $mumu_ba["text"] . '</div></div></div>');
array_push($domList, $sub_arr);
}
//echo( json_encode($domList));
$this->assign('domList', json_encode($domList));
$this->assign('title', '慕慕语录-慕慕');
$this->display('mumu_ba');
}
开发者ID:jiatower,项目名称:php,代码行数:21,代码来源:MumuBa.php
示例20: youxiuAction
function youxiuAction()
{
//global $_F;
//$_F["debug"] = true;
$page = max(1, FRequest::getInt('page'));
$uid = FRequest::getInt('uid');
$nickname = FRequest::getString('nickname');
$where = array("ud.uid" => array('gte' => '5000000'), "ud.avatarlevel" => 9, "um.stat" => 0);
$datetime_riqi_qiantian = date("Y-m-d", time() - 172800);
$query_str = " um.reg_time >= '" . $datetime_riqi_qiantian . " 00:00:00' ";
$where["str"] = $query_str;
$table = new FTable("user_detail", "ud");
$users = $table->fields(array("um.uid", "um.stat", "um.gender", "um.reg_time", "ud.nickname", "ud.avatar", "ud.province", "ud.city", "ud.birthday", "ud.height", "ud.marry", "ud.aboutme"))->leftJoin("user_main", "um", "ud.uid=um.uid")->where($where)->page($page)->limit(100)->order(array("ud.uid" => "desc"))->select();
foreach ($users as &$user) {
$user["age"] = CommonUtil::birthdayToAge($user["birthday"]);
$user["avatar"] = CommonUtil::getMoreSizeImg($user["avatar"], 50, 50);
}
$page_info = $table->getPagerInfo();
$this->assign('page_info', $page_info);
$this->assign('users', $users);
$this->display('admin/user_list_youxiu');
}
开发者ID:jiatower,项目名称:php,代码行数:22,代码来源:User.php
注:本文中的CommonUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论