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'); }
/** * 初始化avatar的md5值 * 文件字段名为file_name */ public function initAvatarAction() { $log2 = new FLogger("images_log"); $t = new FTable("user_detail"); $t->fields(array("uid", "avatar", "avatarlevel"))->where(array("avatarlevel" => array('neq', '-1'), "uid" => array('gt' => '5000000')))->order(array("uid" => "asc")); //$data = $t->limit(10)->select(); $data = $t->select(); echo json_encode($data); // $log2->append(json_encode($data)); foreach ($data as $ud) { $url = $ud["avatar"]; $md5 = self::downAndGetMd5($url); if ($md5 != "") { self::addDb($url, $md5, $ud["avatarlevel"]); } $log2->append("---" . $ud["uid"] . "--" . $ud["avatar"]); } /* echo json_encode($data); if(count($data)<=0) return false; $hArr = array();//handle array foreach($data as $pic){ $h = curl_init(); curl_setopt($h,CURLOPT_URL,$pic['avatar']); curl_setopt($h,CURLOPT_HEADER,0); curl_setopt($h,CURLOPT_RETURNTRANSFER,1);//return the image value array_push($hArr,$h); } $mh = curl_multi_init(); foreach($hArr as $k => $h){ curl_multi_add_handle($mh,$h); } $running = null; do{ curl_multi_exec($mh,$running); }while($running > 0); // get the result and save it in the result ARRAY // $picsArr = array(); foreach($hArr as $k => $h){ $r = curl_multi_getcontent($h); $picsArr[$k]['data'] = $r; echo $k."--".json_encode($picsArr)."<br>"; } //close all the connections foreach($hArr as $k => $h){ $info = curl_getinfo($h); preg_match("/^image/(.*)$/",$info['content_type'],$matches); // echo($info); echo $k."--".md5_file($info)."<br>"; curl_multi_remove_handle($mh,$h); } curl_multi_close($mh);*/ return true; }
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; $where["str"] = $query_str; } $table = new FTable("message", "mm", FDB::$DB_MUMU_MESSAGE); $user_messages = $table->fields(array("mm.to", "mm.content"))->where($where)->page($page)->limit(100)->order(array("mm.id" => "desc"))->select(); foreach ($user_messages as &$user_message) { // $useradd_table = new FTable("user_address"); // $useradd = $useradd_table->where(array('addrid' => $addrid))->find(); $user_message["content"] = json_decode($user_message["content"]); } $page_info = $table->getPagerInfo(); if ($uid > 0) { $this->assign('page_info', $page_info); $this->assign('user_messages', $user_messages); } $this->assign('uid', $uid); $this->display('admin/usermessage_list_jd'); }
/** * 某商品结果(二维码,密码) * @throws Exception */ public function detailAction() { global $_F; /*echo "cookie: ".json_encode($_COOKIE)."<br>";*/ if (!$this->isLogin()) { return; } $id = FRequest::getInt("id"); $table = new FTable("mall_buy_history", "mb"); $buy = $table->where(array("id" => $id))->find(); if ($buy["uid"] != $_F["uid"]) { /* echo "信息不符".json_encode($buy)."---".$_F["uid"]."---".json_encode($_COOKIE);*/ return; } if (!$buy["item_id"] || $buy["item_id"] <= 0) { return; } $this->assign("buy", $buy); $table = new FTable("mall_inventory", "mi"); $r = $table->fields(array("mall.title", "mall.pic", "mi.goods_id", "mi.secrete", "mi.status"))->leftJoin("mall", "mall", "mi.goods_id = mall.id")->where(array("mi.id" => $buy["item_id"]))->find(); $secrete = json_decode($r["secrete"], true); $this->assign("secrete", $secrete); $this->assign("buy_info", $r); $this->assign("base_url", FConfig::get('global.base_url') . "/mall/info"); $this->display('mall_detail'); }
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'); }
/** * 活动列表 */ 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'); }
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'); }
/** * 主报表查询 */ public function defaultAction() { //global $_F; //$_F["debug"] = true; $user_online_table = new FTable("user_online", "uo"); $user_online_man = $user_online_table->leftJoin("user_main", "um", "uo.uid=um.uid")->where(array("um.gender" => 1, "uo.tm" => array('gte' => date("Y-m-d H:i:s", time())), 'uo.uid' => array('gte' => '5000000')))->count(); $user_online_table = new FTable("user_online", "uo"); $user_online_woman = $user_online_table->leftJoin("user_main", "um", "uo.uid=um.uid")->where(array("um.gender" => 2, "uo.tm" => array('gte' => date("Y-m-d H:i:s", time())), 'uo.uid' => array('gte' => '5000000')))->count(); $user_online_table = new FTable("user_main"); $reg_data = $user_online_table->fields(array("gender", "count(*) as num"))->where(array('uid' => array('gte' => '5000000')))->groupBy("gender")->select(); foreach ($reg_data as $data) { $gender = $data["gender"]; if ($gender == 1) { $man_num = $data["num"]; } else { if ($gender == 2) { $woman_num = $data["num"]; } } } $this->assign('user_online_man', $user_online_man); $this->assign('user_online_woman', $user_online_woman); $this->assign('man_num', $man_num); $this->assign('woman_num', $woman_num); $this->display('admin/online'); }
/** * 修改 */ function updateAction() { //global $_F; // $_F["debug"] = true; $topid = FRequest::getInt("topid"); $top_menus = new FTable("top_menus"); $top_menus_menu = $top_menus->fields(array("menu", "name"))->where(array("id" => $topid))->find(); $leftid = FRequest::getInt("leftid"); if ($this->isPost()) { $name = FRequest::getPostString('name'); $url = FRequest::getPostString('url'); $data2 = array('name' => $name, 'menu' => $top_menus_menu['menu'], 'url' => $url); $left_menus = new FTable("left_menus"); $left_menus->where(array('id' => $leftid, 'top_menus_id' => $topid))->update($data2); $this->showMessage("修改成功", $messageType = 'success', "/LeftMenus/list?topid=" . $topid); return; } $left_menus = new FTable("left_menus"); $left_menu = $left_menus->where(array('id' => $leftid))->find(); $this->assign("left_menu", $left_menu); $this->assign("topid", $topid); $this->assign("leftid", $leftid); $this->assign("top_menus_menu", $top_menus_menu); $this->display('admin/left_menus_update'); }
public function cntAction() { global $_F; $tm = date("Y-m-d"); $c_uid = FRequest::getString('c_uid'); $c_sid = FRequest::getString('c_sid'); if ($c_uid == "" || $c_sid == "") { $rs = array("msg" => "参数错误,必选参数c_uid,c_sid", "code" => 201); FResponse::output($rs); return; } $fields = array("stats_date", "c_uid", "c_sid", "sum(reg_cnt) as reg_cnt"); $stats_table = new FTable("stats"); $stats_table->fields($fields); $where = array(); if ($c_uid != "") { $where["c_uid"] = $c_uid; } if ($c_sid != "") { $where["c_sid"] = $c_sid; } $where["stats_date"] = $tm; $logList = $stats_table->where($where)->select(); $empty = array("stats_date" => $tm, "c_uid" => $c_uid, "c_sid" => $c_sid, "reg_cnt" => 0); if (count($logList) > 0) { FResponse::output($logList[0]); return; } FResponse::output($empty); }
public function getCategoryAction() { $parent_id = FRequest::getInt('parent_id'); $categoryTable = new FTable('category'); $cateList = $categoryTable->fields(array('cat_id', 'cat_name'))->where(array('status' => 1, 'parent_id' => $parent_id))->order(array('sort' => 'desc'))->select(); FResponse::output($cateList); }
/** * 返回用户是登录状态 * @return bool */ protected function isLogin() { global $_F; $uid = FCookie::get("uid"); $sid = FCookie::get("key"); $table = new FTable("user_main"); $user = $table->fields(array("sid"))->where(array("uid" => $uid))->find(); $_F["uid"] = $uid; return $user["sid"] == $sid; }
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'); }
function listAction() { //global $_F; //$_F["debug"] = true; $page = max(1, FRequest::getInt('page')); $table = new FTable("top_menus", "tm"); $top_menus = $table->fields(array("tm.id", "tm.name", "tm.menu"))->page($page)->limit(20)->order(array("tm.id" => "asc"))->select(); $page_info = $table->getPagerInfo(); $this->assign('page_info', $page_info); $this->assign("top_menus", $top_menus); $this->display('admin/top_menus_list'); }
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'); }
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'); }
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'); }
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'); }
public static function getLeftMenus($top) { global $_F; $manager_table = new FTable("manager"); $manager = $manager_table->where(array('uid' => $_F["uid"]))->find(); $top_menus_ids = explode(",", $manager['top_menus_id']); $left_menus_ids = explode(",", $manager['left_menus_id']); /*$left_menus=array(); $left_menus['default'] =array( array('name' => '创建幕幕帐号', 'url' => '/admin/YUser/add', 'url_jian' => '/admin/YUser/add'), array('name' => '在线用户', 'url' => '/admin/Online/default', 'url_jian' => '/admin/Online/default') ); foreach($top_menus_ids as &$top_menus_id) { $left_menus_x=array(); $top_menus_table = new FTable("top_menus"); $top_menus1 = $top_menus_table->fields(array("name", "id","menu"))->where(array("id" => $top_menus_id))->find(); $left_menus_table = new FTable("left_menus"); $left_menus1 = $left_menus_table->fields(array("name", "url"))->where(array("top_menus_id" => $top_menus1['id'],"id"=>array('in' => $left_menus_ids)))->select(); // $left_menus_x[$top_menus1['menu']]=$left_menus1; // array_push($left_menus[$top_menus1['menu']],$left_menus1); foreach($left_menus1 as &$left_menus12){ $left=explode("/",$left_menus12["url"]); $left_menus12["url_jian"] = "/".$left[1]."/".$left[2]."/"; } $left_menus[$top_menus1['menu']]=$left_menus1; } echo(json_encode($left_menus)); $menuArray =$left_menus; $menuItems = $menuArray[$top];*/ $left_menus_table = new FTable("left_menus"); $left_menus1 = $left_menus_table->fields(array("name", "url"))->where(array("menu" => $top, "id" => array('in' => $left_menus_ids)))->select(); foreach ($left_menus1 as &$left_menus12) { $left = explode("/", $left_menus12["url"]); $left_menus12["url_jian"] = "/" . $left[1] . "/" . $left[2] . "/"; } $menuItems = $left_menus1; return $menuItems; }
function listAction() { global $_F; //$_F["debug"] = true; $admin_uid = FSession::get('manager_uid'); $uid = FRequest::getInt("uid"); $page = max(1, FRequest::getInt('page')); $user_table = new FTable("user_detail"); $user_nickname = $user_table->fields(array("nickname"))->where(array("uid" => $uid))->find(); $where = array('uadd.uid' => $uid); $table = new FTable("user_address", "uadd"); $useradds = $table->fields(array("uadd.uid", "uadd.addrid", "uadd.phone", "uadd.province", "uadd.city", "uadd.address", "uadd.username"))->where($where)->page($page)->limit(20)->order(array("uadd.addrid" => "desc"))->select(); $page_info = $table->getPagerInfo(); $this->assign('page_info', $page_info); $this->assign("useradds", $useradds); $this->assign("uid", $uid); $this->assign("user_nickname", $user_nickname['nickname']); $this->display('admin/y_user_address_list'); }
/** * 列表 */ 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'); }
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'); }
function listAction() { //global $_F; //$_F["debug"] = true; $page = max(1, FRequest::getInt('page')); $uid = FRequest::getInt('uid'); $where = array(); if ($uid) { $where["vr.uid"] = $uid; } else { $where["vr.status"] = 0; } $table = new FTable("video_record", "vr"); $users = $table->fields(array("vr.uid", "vr.id", "vr.photos", "vr.status", "vr.tm", "ud.video_img", "ud.nickname", "um.reg_ip", "um.model", "um.sysver"))->leftJoin("user_detail", "ud", "vr.uid=ud.uid")->leftJoin("user_main", "um", "vr.uid=um.uid")->where($where)->page($page)->limit(20)->order(array("vr.id" => "asc"))->select(); foreach ($users as &$user) { $user["video_img"] = CommonUtil::getMoreSizeImg($user["video_img"], 222, 222); } $page_info = $table->getPagerInfo(); $this->assign('page_info', $page_info); $this->assign('users', $users); $this->assign('uid', $uid); $this->display('admin/user_video_record'); }
/** * 添加地址 */ function listAction() { //global $_F; // $_F["debug"] = true; $page = max(1, FRequest::getInt('page')); $type = CommonUtil::getDefStr(FRequest::getString('type'), "main"); $this->assign('type', $type); $where = array(); $shanchu_id = FRequest::getInt('shanchu_id'); if ($shanchu_id) { $focus = new FTable('focus'); $focus->where(array('id' => $shanchu_id))->remove(true); } $xiaxian_id = FRequest::getInt('xiaxian_id'); if ($xiaxian_id) { $events_table = new FTable("focus"); $events_table->where(array("id" => $xiaxian_id))->update(array("status" => 0)); } $shangxian_id = FRequest::getInt('shangxian_id'); if ($shangxian_id) { $events_table = new FTable("focus"); $events_table->where(array("id" => $shangxian_id))->update(array("status" => 1)); } if ($type) { $where['type'] = $type; } $table = new FTable("focus"); $focus = $table->fields(array("id", "type", "text", "pic", "action", "position", "status"))->where($where)->page($page)->limit(20)->order(array("position" => "asc", "id" => "desc"))->select(); foreach ($focus as &$focu) { $focu["pic"] = CommonUtil::getMoreSizeImg($focu["pic"], 100, 100); $focu["action"] = json_decode($focu["action"]); } $page_info = $table->getPagerInfo(); $this->assign('page_info', $page_info); $this->assign('focus', $focus); $this->display('admin/focus_list'); }
/** * 添加地址 */ function listAction() { //global $_F; // $_F["debug"] = true; $page = max(1, FRequest::getInt('page')); $text = FRequest::getString('text'); $where = array(); $shanchu_id = FRequest::getInt('shanchu_id'); if ($shanchu_id) { $guanwang_newss = new FTable('guanwang_news'); $guanwang_newss->where(array('id' => $shanchu_id))->remove(true); } $table = new FTable("guanwang_news"); $guanwang_newss = $table->fields(array("id", "title", "text", "riqi"))->where($where)->page($page)->limit(20)->order(array("id" => "desc"))->select(); foreach ($guanwang_newss as &$guanwang_news) { $query = explode("-", $guanwang_news['riqi']); $guanwang_news["yue"] = self::NumChinese(intval($query[1])); $guanwang_news["ri"] = $query[2]; } $page_info = $table->getPagerInfo(); $this->assign('page_info', $page_info); $this->assign('guanwang_news', $guanwang_newss); $this->display('admin/guanwang_news_list'); }
/** * 创建幕幕管理员用户 */ public static function addUser() { //判断5000000uid一下的最新一个 $user_table = new FTable("user_main"); $sql_str = " uid < 5000000 and uid > 1000000 "; $user = $user_table->fields(array("uid"))->where(array("str" => $sql_str))->order(array("uid" => "desc"))->find(); $password = microtime(); $sid = Service_Manager::getEncryptPassword($password); if (!$user) { $user["uid"] = 1000000; } $data = array('uid' => $user['uid'] + 1, 'gender' => 1, 'kf_id' => 0, 'reg_time' => date('Y-m-d H:i:s'), 'sid' => $sid); $user_table = new FTable("user_main"); $uid = $user_table->insert($data); $data2 = array('uid' => $uid, 'nickname' => "admin_test", 'age' => 1, 'avatar' => ""); $user_detail_table = new FTable("user_detail"); $user_detail_table->insert($data2); $admin_table = new FTable("admin"); $data3 = array("uid" => $uid); $admin_table->insert($data3); return $uid; }
/** * 审核用户详情 */ function updateAction() { global $_F; $uid = FRequest::getInt("uid"); $user_detail_table = new FTable("user_main", "um"); $user = $user_detail_table->leftJoin("user_detail", "ud", "um.uid=ud.uid")->where(array("um.uid" => $uid))->select(); $user[0]["age"] = CommonUtil::birthdayToAge($user[0]["birthday"]); $interests = explode(",", $user[0]["interest"]); $this->assign("old_interests", $interests); $photo_table = new FTable("user_photo_album"); $photos = $photo_table->fields(array("pic", "albumid"))->where(array("uid" => $uid, "first_status" => 0))->select(); $photo_arr = $photos; $uid_d = $uid; $table2 = new FTable("image_md5", "im"); $image_md5 = $table2->fields(array("im.md5"))->where(array("im.url" => $user[0]["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[0]["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[0]["uid_d"] = $uid_d; $user[0]["uid_i"] = $i; $user[0]["avatar"] = CommonUtil::getMoreSizeImg($user[0]["avatar"], 222, 222); $this->assign("user", $user[0]); $update_record = new FTable("update_record"); $updates = $update_record->fields(array("item"))->where(array("uid" => $uid, "status" => 0))->select(); //$update_arr = $updates; //$size = count($updates); $update_arr = array(); $j = 0; foreach ($updates as $update) { $update_arr[$j] = $update['item']; $j++; } //echo(json_encode($update_arr)); if (in_array("nickname", $update_arr)) { $nickname = "red"; } if (in_array("avatar", $update_arr)) { $avatar = "red"; } if (in_array("aboutme", $update_arr)) { $aboutme = "red"; } /* $photo_arr = array(); foreach($photos as $photo){ array_push($photo_arr,$photo["pic"]); }*/ //echo(count($photo_arr)); $this->assign("photos", $photo_arr); $this->assign("photos_num", count($photo_arr)); $this->assign("stars", self::$STARS); $this->assign("nickname", $nickname); $this->assign("avatar", $avatar); $this->assign("aboutme", $aboutme); $this->display('admin/y_user_update'); }
public function puzzle2Action() { global $_F; // $_F["debug"] = true; $uid = FRequest::getInt('uid'); $id = FRequest::getInt('id'); $table = new FTable("dynamics", "dy"); $dy = $table->where(array("id" => $id))->find(); // echo(json_encode($dy)); if (!$dy || $dy["uid"] <= 0) { return; } $user = Service_Client::getUserByUid($uid); $table2 = new FTable("comment", "c"); $tms = $table2->fields(array("ud.uid", "ud.nickname", "ud.avatar", "c.*"))->where(array("source_id" => $id, "status" => 0, "source_type" => 1, "type" => 3))->leftJoin("user_detail", "ud", "c.uid = ud.uid")->select(); $join = false; $join_item = array(); foreach ($tms as $key => &$tmItem) { if ($tmItem["avatar"] == "" || $tmItem["nickname"] == "") { unset($tms[$key]); continue; } $avatar = $tmItem["avatar"]; $tmItem["avatar"] = CommonUtil::getMoreSizeImg($avatar, 100, 100); if ($tmItem["uid"] == $uid) { $join = true; $join_item = $tmItem; break; } } if (count($tms) > 10) { $tms_10 = array_slice($tms, 0, 10); } else { $tms_10 = $tms; } // 如果用户参与了拼图游戏,则需要结算胜率 if ($join) { $this->assign("tm", $join_item["content"]); } $dy["pic"] = CommonUtil::getMoreSizeImg($dy["pic"], 200, 200); $dy["pic_big"] = CommonUtil::getMoreSizeImg($dy["pic"], 400, 400); $user["avatar"] = CommonUtil::getMoreSizeImg($user["avatar"], 50, 50); $this->assign("tms", $tms_10); $this->assign("join", $join); $this->assign("dy", $dy); $this->assign("user", $user); $this->display('sharePuzzle2'); /*$this->display('sliding');*/ }
function listAction() { global $_F; //$_F["debug"] = true; $province = FRequest::getString('province'); $city = FRequest::getString('city'); $gender = CommonUtil::getComParam(FRequest::getInt('gender'), 2); $age = FRequest::getInt('age'); $table = new FTable("user_province_area"); $provinces = $table->order(array("region_id" => "asc"))->select(); if ($province) { $where = array("city" => $province); $user_province = new FTable("user_province_area"); $user_provinces = $user_province->where($where)->find(); $stm_str = "-" . $age . " year"; $etm_str = "-" . ($age - 1) . " year"; $stm_birthday = date("Y-01-01 00:00:00", strtotime($stm_str)); $etm_birthday = date("Y-01-01 00:00:00", strtotime($etm_str)); $query_str = " ud.birthday >= '" . $stm_birthday . "' and ud.birthday < '" . $etm_birthday . "' "; $user_table = new FTable("user_main", "um"); $user = $user_table->where(array("um.gender" => $gender, "str" => $query_str))->leftJoin("user_detail", "ud", "um.uid=ud.uid")->find(); $url = FConfig::get('global.service_mumu_url') . "/s/discovery/IAdjacent"; //$url = "http://yfservice.admin.docker:8081/s/discovery/IAdjacent"; //echo($url); $post_data = array("lng" => $user_provinces['x'], "lat" => $user_provinces['y'], "cur" => 1, "refresh" => true, "ps" => 30, "uid" => $user["uid"]); //$cookie = "sid=306123456;uid=5000513;key=306123456"; $cookie = "sid=" . FSession::get('sid') . ";uid=" . FSession::get('user_id') . ";key=" . FSession::get('sid'); $output = FHttp::doPost($url, $post_data, $cookie); // print_r($output); $output = json_decode($output); $status = $output->status; $users = $output->res; $users = $users->users; $users = $users->list; if (count($users) <= 30) { $post_data = array("lng" => $user_provinces['x'], "lat" => $user_provinces['y'], "cur" => 2, "refresh" => true, "ps" => 30, "uid" => $user["uid"]); $output2 = FHttp::doPost($url, $post_data, $cookie); $output2 = json_decode($output2); $users2 = $output2->res; $users2 = $users2->users; $users2 = $users2->list; } $users = array_merge($users, $users2); $ids = array(); foreach ($users as $u) { array_push($ids, $u->uid); } if (count($ids) > 0) { $users_table = new FTable("user_main", "um"); $u_arr = $users_table->fields(array("um.uid", "um.gender", "ud.localtag", "ud.birthday"))->where(array("um.uid" => array("in" => $ids)))->leftJoin("user_detail", "ud", "um.uid = ud.uid")->select(); } $u_m = array(); foreach ($u_arr as $u) { $u_m[$u["uid"]] = $u; } foreach ($users as &$u) { $uid = $u->uid; $r_u = $u_m[$uid]; $u->age = CommonUtil::birthdayToAge($r_u["birthday"]); $u->tag = $r_u["localtag"]; $u->gender = $r_u["gender"]; } $this->assign('users', $users); $this->assign('status', $status); $this->assign('province', $province); $this->assign('city', $city); $this->assign('age', $age); } $this->assign('gender', $gender); $this->assign('provinces', $provinces); $this->display('admin/user_avataradd_list'); }
/** * 按时间地区在线人数 */ public function zaixianAction() { $c_uid = CommonUtil::getDefStr(FRequest::getString('c_uid'), ""); $c_sid = CommonUtil::getDefStr(FRequest::getString('c_sid'), ""); $stats_date = FRequest::getString('stats_date'); $province = FRequest::getString('province'); $user_type = CommonUtil::getComParam(FRequest::getInt('user_type'), -1); $this->assign('sc_uid', $c_uid); $this->assign('sc_sid', $c_sid); $this->assign('stats_date', $stats_date); $this->assign('province', $province); $this->assign('user_type', $user_type); $table = new FTable("user_province_area"); $user_province = $table->groupBy("province")->order(array("id" => "asc"))->select(); $this->assign('user_province', $user_province); $data = array(); $data_1 = array(); $data_2 = array(); $where = array("s.key" => "on_top_users"); if ($c_uid != "") { $where["channel"] = $c_uid; } if ($c_sid != "") { $where["sub_channel"] = $c_sid; } if ($province) { $where["province"] = $province; } if ($user_type >= 0) { // $where["user_type"] = $user_type; } if ($stats_date && $stats_date != "") { $where["tm"] = array('like' => $stats_date); $where["s.interval"] = "hour"; } else { $where["s.interval"] = "day"; } $fields = array("s.tm", "s.key", "s.gender", "sum(s.value) as sum"); $table2 = new FTable("Stat", "s", FDB::$DB_MUMU_STAT); $total_rs = $table2->fields($fields)->where($where)->groupBy("s.tm")->order(array("s.tm" => "desc"))->select(); $total = count($total_rs); $kaishi_time = $total_rs[30][tm]; $jieshu_time = $total_rs[0][tm]; /* if ($total>30) { $jieshu_time=$total_rs[29][tm]; } else { $jieshu_time=$total_rs[$total-1][tm]; }*/ // echo($kaishi_time.$jieshu_time); if ($total > 0) { $query_str = " s.tm >= '" . $kaishi_time . "' and s.tm <= '" . $jieshu_time . "' "; $where["str"] = $query_str; } $table = new FTable("Stat", "s", FDB::$DB_MUMU_STAT); $Stat = $table->fields($fields)->where($where)->groupBy("s.tm,s.key,s.gender")->order(array("s.tm" => "desc"))->select(); $Stats = array(); foreach ($Stat as &$s) { $sub_arr = array(); $s["tm"] = $s["tm"]; if (array_key_exists($s["tm"], $Stats)) { $sub_arr = $Stats[$s["tm"]]; } array_push($sub_arr, $s); $Stats[$s["tm"]] = $sub_arr; } $Stats2 = array(); foreach ($Stats as &$s) { $sub_arr = array("tm" => ""); foreach ($s as &$s_x) { $sub_arr["tm"] = $s_x["tm"]; $stats_key = $s_x["key"] . "_" . $s_x["gender"]; $sub_arr[$stats_key] = $s_x["sum"]; } $data[$sub_arr["tm"]] = $sub_arr["tm"]; if ($sub_arr["on_top_users_1"]) { $data_1[$sub_arr["tm"]] = $sub_arr["on_top_users_1"]; } else { $data_1[$sub_arr["tm"]] = 0; } if ($sub_arr["on_top_users_2"]) { $data_2[$sub_arr["tm"]] = $sub_arr["on_top_users_2"]; } else { $data_2[$sub_arr["tm"]] = 0; } array_push($Stats2, $sub_arr); } $data1 = array(); $i = 0; foreach ($data as $d) { if ($stats_date && $stats_date != "") { $data1[$i] = substr(substr($d, 0, 13), -2); } else { $data1[$i] = substr($d, 0, 10); } $i++; } $data1_1 = array(); $i = 0; foreach ($data_1 as $d) { $data1_1[$i] = $d; $i++; } $data1_2 = array(); $i = 0; foreach ($data_2 as $d) { $data1_2[$i] = $d; $i++; } $spmList = Service_Edit::getAllSpm(); $this->assign('spmarr', json_encode($spmList)); $c_names = Service_Edit::getSpmMap($spmList); $this->assign('spmList', $c_names); $this->assign("data_1", json_encode(array_reverse($data1_1))); $this->assign("data_2", json_encode(array_reverse($data1_2))); $this->assign("data", json_encode(array_reverse($data1))); $this->display('admin/user_spread_zaixian'); }