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); }
/** * 活动列表 */ 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'); $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'); }
public function defaultAction() { //global $_F; //$_F["debug"] = true; $url = FRequest::getString('url'); $this->assign('url', $url); $this->display('sliding'); }
public function defaultAction() { global $_F; $url = FRequest::getString('url'); $gender = FRequest::getString('gender'); $this->assign('url', $url); $this->assign('gender', $gender); $this->assign('title', '匹配'); $this->display('zhanbu2'); }
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 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'); }
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 function defaultAction() { global $_F; $url = "http://down.mumu123.cn/mumu/MuMu_1617_1000_6_1.005.apk"; $mumu_auth = FCookie::get('mumu_auth'); $v = FRequest::getString('v'); if ($v) { FResponse::redirect($url); } else { if ($mumu_auth) { FResponse::redirect($url); } else { FResponse::redirect('/public/reg'); } } }
/** * 图片检测接口 * img 图片url */ public function checkImgAction() { //sleep(50); $log = new FLogger("images_log"); $url = FRequest::getString('imgs'); $item = FRequest::getInt("type"); if (!$url) { FResponse::output(array('status' => 'fail', 'msg' => 'parm img is empty')); return; } if (!$item || $item <= 0) { FResponse::output(array('status' => 'fail', 'msg' => 'parm type is empty')); return; } $images = explode(",", $url); if (!$images || count($images) <= 0) { FResponse::output(array('status' => 'fail', 'msg' => 'the length of images is less than 0')); return; } // 检测图片域名 foreach ($images as &$url) { $S = parse_url($url); $S = strtolower($S['host']); //取域名部分 if ($item == Service_TupuTech::$SEXY_AND_AD && !(strpos($S, "yuanfenba.net") || strpos($S, "mumu123.cn"))) { FResponse::output(array('status' => 'fail', 'msg' => 'the host of image is error')); return; } if (strpos($S, "yuanfenba.net") || strpos($S, "mumu123.cn")) { $url = CommonUtil::getImgBySize($url, 256); } } $log->append("checkImgAction - begin :" . time() . json_encode($images)); $res = Service_TupuTech::doCheckImages($images, $item); $log->append("checkImgAction - 1 :" . time()); if ($res["code"] == 0) { $data = Service_Images::addImagesRecord($res, $item); FResponse::output($data); } else { $log->append("[ERROR] checkImgAction is error" . json_encode($res)); FResponse::output(array('status' => 'fail', 'msg' => 'check img is error')); } $log->append("checkImgAction - end :" . time()); }
public function defaultAction() { // global $_F; //$_F["debug"] = true; $c_uid = FRequest::getString('c_uid'); $c_sid = FRequest::getString('c_sid'); if ($c_uid && $c_sid) { $this->assign('xiazai', 'http://service.imswing.cn/common/Download?c_uid=' . $c_uid . '&c_sid=' . $c_sid); } else { $this->assign('xiazai', 'http://service.imswing.cn/common/Download?c_uid=8000&c_sid=1001'); } $this->assign('c_uid', $c_uid); $this->assign('c_sid', $c_sid); if (self::isMobile()) { $this->display('m'); } else { $this->display('index'); } }
/** * 用户资料首审 */ function verifyUserFirstAction() { $uid = FRequest::getInt("uid"); $status = FRequest::getInt("status"); $reason = FRequest::getString("reason"); if (CommonUtil::parmIsEmpty($uid) || CommonUtil::parmIsEmpty($status)) { FResponse::output(CommonUtil::GetDefRes(201, "参数错误")); return; } // 检测如果已经存在需要复审记录,则直接返回 $table2 = new FTable("verify_user"); $n = $table2->where(array("uid" => $uid, "flag" => 0))->count(); if ($n > 0) { FResponse::output(CommonUtil::GetDefRes(200, "操作成功")); return; } // 原子操作,开启事务处理 FDB::begin(); try { // 修改用户资料修改记录状态 $table = new FTable("update_record"); $table->where(array("uid" => $uid, "status" => 0))->update(array("status" => 1)); // 插入到复审的表里 $table2 = new FTable("verify_user"); $id = $table2->insert(array("uid" => $uid, "status" => $status, "reason" => $reason, "aid" => FSession::get('user_id'))); FDB::commit(); } catch (Exception $e) { FDB::rollBack(); //写入日志 $log = new FLogger("user_log"); $log->append("verifyUserFirstAction:" . $e); FResponse::output(CommonUtil::GetDefRes(201, "操作失败")); return; } // FResponse::output(CommonUtil::GetDefRes(200,"操作成功")); //下面是一审完了,走二审接口 /*$table2 = new FTable("verify_user","vu"); $verify_user = $table2->fields(array("vu.id")) ->where(array("vu.uid"=>$uid,"vu.flag"=>0))->find();*/ $url = FConfig::get('global.service_mumu_url') . "/s/user/IUserInfoVerify"; $res = Service_Common::secPost($url, array("id" => $id, "uid" => $uid, "level" => $status)); FResponse::output($res); }
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'); }
/** * 添加地址 */ 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) { $mumu_youxis = new FTable('mumu_youxi'); $mumu_youxis->where(array('id' => $shanchu_id))->remove(true); } $table = new FTable("mumu_youxi"); $mumu_youxis = $table->fields(array("id", "title", "text", "pic", "url", "position"))->where($where)->page($page)->limit(20)->order(array("position" => "asc", "id" => "desc"))->select(); foreach ($mumu_youxis as &$mumu_youxi) { $mumu_youxi["pic"] = CommonUtil::getMoreSizeImg($mumu_youxi["pic"], 100, 100); } $page_info = $table->getPagerInfo(); $this->assign('page_info', $page_info); $this->assign('mumu_youxi', $mumu_youxis); $this->assign('text', $text); $this->display('admin/mumu_youxi_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'); }
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'); }
/** * 用户地区分部或者年龄分部 */ public function ageSpreadAction() { $c_uid = CommonUtil::getDefStr(FRequest::getString('c_uid'), ""); $c_sid = CommonUtil::getDefStr(FRequest::getString('c_sid'), ""); $stats_date = FRequest::getString('stats_date'); $this->assign('sc_uid', $c_uid); $this->assign('sc_sid', $c_sid); $this->assign('stats_date', $stats_date); $where = array("um.uid" => array("gt" => 5000000)); if ($c_uid != "") { $where["um.channel_uid"] = $c_uid; } if ($c_sid != "") { $where["um.channel_sid"] = $c_sid; } if ($stats_date) { $stm = date("Y-m-d 00:00:00", strtotime($stats_date)); // 昨天凌晨 $etm = date("Y-m-d 00:00:00", strtotime($stats_date . "+1 day")); $where["str"] = " um.reg_time > '" . $stm . "' and um.reg_time < '" . $etm . "'"; } // 查询用户省份数据 $user_table = new FTable("user_main", "um"); $data = $user_table->fields(array("(YEAR(curdate())-YEAR(ud.birthday)) as age", "um.gender", "count(*) as num"))->leftJoin("user_detail", "ud", "um.uid = ud.uid")->groupBy("um.gender,YEAR(ud.birthday)")->where($where)->select(); // echo(json_encode($data)); $user_table2 = new FTable("user_main", "um"); $data2 = $user_table2->fields(array("(YEAR(curdate())-YEAR(ud.birthday)) as age", "count(*) as num"))->leftJoin("user_detail", "ud", "um.uid = ud.uid")->groupBy("YEAR(ud.birthday)")->where($where)->order(array("num" => "desc"))->limit(30)->select(); $rs = array("default" => array("1" => 0, "2" => 0)); $p_arr = array(); foreach ($data2 as $ages) { $age = $ages["age"]; if (!$age || empty($age)) { $age = "缺省"; } array_push($p_arr, $age); } foreach ($data as $d) { $rm = array("1" => 0, "2" => 0); $age = $d["age"]; if (!$age || empty($age)) { $age = "缺省"; } $gender = $d["gender"]; if (array_key_exists($age, $rs)) { $rm = $rs[$age]; } $rm[$gender] += $d["num"]; $rs[$age] = $rm; } $data_1 = array(); $data_2 = array(); foreach ($p_arr as $p) { $d = $rs[$p]; $d_1 = 0; $d_2 = 0; if ($d && $d["1"]) { $d_1 = $d["1"]; } if ($d && $d["2"]) { $d_2 = $d["2"]; } $data_1[count($data_1)] = $d_1; $data_2[count($data_2)] = $d_2; } $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($data_1)); $this->assign("data_2", json_encode($data_2)); $this->assign("ages", json_encode($p_arr)); $this->display('admin/user_age_spread'); }
/** * 根据时间获取所有照片和完善资料记录 */ public function detailAction() { $date = FRequest::getString("date"); $item = FRequest::getString("item"); $stm = date("Y-m-d 00:00:00", strtotime($date)); // 昨天凌晨 $etm = date("Y-m-d 00:00:00", strtotime($date . "+1 day")); $str = " u.reg_time>='" . $stm . "' and u.reg_time < '" . $etm . "'"; // echo $str; $ht_table = new FTable("honesty_record", "h"); $data = $ht_table->fields(array("DATE(h.tm) as t", "count(*) as cnt ", "u.gender as g"))->leftJoin("user_main", "u", "h.uid = u.uid")->where(array("h.item" => array("eq" => $item), "str" => $str))->groupBy("DATE(h.tm)", "g")->select(); $res = array(); foreach ($data as $d) { $item = array("1" => 0, "2" => 0); if (array_key_exists($d["t"], $res)) { $item = $res[$d["t"]]; } $item[$d["g"]] = $d["cnt"]; $res[$d["t"]] = $item; } $this->assign('date', $date); $this->assign('item', $item); $this->assign('data', $res); $this->display('admin/user_certify_detail'); }
public function updateAction() { $c_uid = trim(FRequest::getString("c_uid")); $ver = FRequest::getInt("ver"); $status = FRequest::getInt("status"); $c_sid = trim(FRequest::getString("c_sid")); $data = array('status' => $status); $where = array('ver' => $ver, 'c_uid' => $c_uid, 'c_sid' => $c_sid); $t = new FTable("app_version"); $t->update($data, $where); FResponse::output(CommonUtil::GetDefRes(200, "操作成功")); return; }
/** * */ function defaultAction() { // $datetime_zuotian = date("Y-m-d ", time() - 86400); // $datetime_jintian = date("Y-m-d ", time()); $datetime_jintian = FRequest::getString("datetime_jintian"); if ($datetime_jintian) { //$datetime_jintian = "2015-07-04"; //$datetime_jintian = date("Y-m-d ", time()); $datetime_zuotian = date("Y-m-d", strtotime("{$datetime_jintian} - 1 days")); $query_str = " tm >= '" . $datetime_zuotian . " 00:00:00' and tm < '" . $datetime_jintian . " 00:00:00' "; $query_str2 = " ac.tm >= '" . $datetime_zuotian . " 00:00:00' and ac.tm < '" . $datetime_jintian . " 00:00:00' "; $user_star_date = array(); $user_star_date['date'] = $datetime_zuotian; $table = new FTable("Actions", "ac", FDB::$DB_MUMU_STAT); $actions = $table->fields(array("count(*) as count", "gender"))->where(array("str" => $query_str2, "type" => 22))->groupBy("gender")->select(); foreach ($actions as $action) { if ($action['gender'] == 1) { $user_star_date['login_man'] = $action['count']; } if ($action['gender'] == 2) { $user_star_date['login_woman'] = $action['count']; } } $table = new FTable("user_star_level", "usl"); $usls = $table->fields(array("usl.uid"))->where(array("usl.level" => array('gte' => '1')))->select(); $user_ids = array(); foreach ($usls as $usl) { array_push($user_ids, $usl['uid']); } $user_ids = implode(",", $user_ids); //echo($user_ids); $table = new FTable("user_star_level", "usl"); $usls = $table->fields(array("count(*) as count", "level", "gender"))->where(array("usl.level" => array('gte' => '1')))->groupBy("level,gender")->select(); // echo(json_encode($usls)); foreach ($usls as $usl) { if ($usl['level'] == '1') { if ($usl['gender'] == '1') { $user_star_date["level1_man"] = $usl['count']; } if ($usl['gender'] == '2') { $user_star_date["level1_woman"] = $usl['count']; } } if ($usl['level'] == '2') { if ($usl['gender'] == '1') { $user_star_date["level2_man"] = $usl['count']; } if ($usl['gender'] == '2') { $user_star_date["level2_woman"] = $usl['count']; } } if ($usl['level'] == '3') { if ($usl['gender'] == '1') { $user_star_date["level3_man"] = $usl['count']; } if ($usl['gender'] == '2') { $user_star_date["level3_woman"] = $usl['count']; } } } $table = new FTable("user_star_level", "usl"); $usls = $table->fields(array("count(*) as count", "level", "gender"))->where(array("usl.level" => array('in' => '1,2'), "changes" => "-1", "str" => $query_str))->groupBy("level,gender")->select(); // echo(json_encode($usls)); foreach ($usls as $usl) { if ($usl['level'] == '2') { if ($usl['gender'] == '1') { $user_star_date["level3_2_man"] = $usl['count']; } if ($usl['gender'] == '2') { $user_star_date["level3_2_woman"] = $usl['count']; } } if ($usl['level'] == '1') { if ($usl['gender'] == '1') { $user_star_date["level2_1_man"] = $usl['count']; } if ($usl['gender'] == '2') { $user_star_date["level2_1_woman"] = $usl['count']; } } } $table = new FTable("Actions", "ac", FDB::$DB_MUMU_STAT); $actions = $table->where(array("str" => $query_str2, "uid" => array('in' => $user_ids), "gender" => 1, "type" => '9'))->groupBy("uid")->select(); $user_star_date['star_message_man'] = count($actions); $table = new FTable("Actions", "ac", FDB::$DB_MUMU_STAT); $actions = $table->where(array("str" => $query_str2, "uid" => array('in' => $user_ids), "gender" => 2, "type" => '9'))->groupBy("uid")->select(); $user_star_date['star_message_woman'] = count($actions); $table = new FTable("Actions", "ac", FDB::$DB_MUMU_STAT); $actions = $table->fields(array("count(*) as count", "gender", "type"))->where(array("str" => $query_str2, "uid" => array('in' => $user_ids), "type" => array('in' => '10,9')))->groupBy("type,gender")->select(); foreach ($actions as $action) { //总消息量 if ($action['type'] == '9') { if ($action['gender'] == 1) { $user_star_date['star_messages_man'] = $action['count']; } if ($action['gender'] == 2) { $user_star_date['star_messages_woman'] = $action['count']; } } //关注人数 if ($action['type'] == '10') { if ($action['gender'] == 1) { $user_star_date['star_follow_man'] = $action['count']; } if ($action['gender'] == 2) { $user_star_date['star_follow_woman'] = $action['count']; } } } $table = new FTable("Actions", "ac", FDB::$DB_MUMU_STAT); $actions = $table->where(array("str" => $query_str2, "uid" => array('in' => $user_ids), "gender" => 1, "type" => '13'))->groupBy("uid")->select(); $user_star_date['star_game_man'] = count($actions); $table = new FTable("Actions", "ac", FDB::$DB_MUMU_STAT); $actions = $table->where(array("str" => $query_str2, "uid" => array('in' => $user_ids), "gender" => 2, "type" => '13'))->groupBy("uid")->select(); $user_star_date['star_game_woman'] = count($actions); //echo(json_encode($user_star_date)); $table = new FTable("user_star_date"); $user_star_date1 = $table->where(array("date" => $datetime_zuotian))->select(); if ($user_star_date1) { $user_star_level_table = new FTable("user_star_date"); $result = $user_star_level_table->where(array('date' => $datetime_zuotian))->update($user_star_date); } else { $user_star_level_table = new FTable("user_star_date"); $result = $user_star_level_table->insert($user_star_date); } if ($result) { //$this->success('插入成功!'); } else { //$this->error("插入失败"); } } }
/** * 主报表查询 */ public function reportAction() { //global $_F; //$_F["debug"] = true; $page_size = 30; $page = max(1, FRequest::getInt('page')); $c_uid = CommonUtil::getDefStr(FRequest::getString('c_uid'), ""); $user_gender = CommonUtil::getComParam(FRequest::getInt('user_gender'), -1); $stats_date = FRequest::getString('stats_date'); $stats_key = FRequest::getString('stats_key'); $province = FRequest::getString('province'); $ver = FRequest::getString('ver'); $table = new FTable("user_province_area"); $user_province = $table->groupBy("province")->order(array("id" => "asc"))->select(); $this->assign('user_province', $user_province); $this->assign('province', $province); $this->assign('ver', $ver); if (!$stats_key) { $stats_key = "online_award_users"; // $stats_key="on_top_users"; // $this->showMessage("查询留存不能为空",error,"/admin/ReportLiucun/default"); // // return; // exit; } $where = array("s.interval" => "day"); if ($c_uid != "") { $where["channel"] = $c_uid; } if ($user_gender >= 0) { $where["gender"] = $user_gender; } if ($province) { $where["province"] = $province; } if ($ver) { $where["ver"] = $ver; } $stats_key0 = $stats_key . "_lc_0"; $stats_key1 = $stats_key . "_lc_1"; $stats_key2 = $stats_key . "_lc_2"; $stats_key3 = $stats_key . "_lc_3"; $stats_key4 = $stats_key . "_lc_4"; $stats_key5 = $stats_key . "_lc_5"; $stats_key6 = $stats_key . "_lc_6"; $stats_key7 = $stats_key . "_lc_7"; $stats_key15 = $stats_key . "_lc_15"; $stats_key30 = $stats_key . "_lc_30"; $stats_key_array = array("'register'", "'" . $stats_key0 . "'", "'" . $stats_key1 . "'", "'" . $stats_key2 . "'", "'" . $stats_key3 . "'", "'" . $stats_key4 . "'", "'" . $stats_key5 . "'", "'" . $stats_key6 . "'", "'" . $stats_key7 . "'", "'" . $stats_key15 . "'", "'" . $stats_key30 . "'"); $fields = array("s.tm", "s.key", "sum(s.value) as sum"); //echo(json_encode($stats_key_array)); $where["s.key"] = array('in' => $stats_key_array); $datetime_riqi_qiantian = date("Y-m-d", time() - 86400); $query_str = " s.tm <= '" . $datetime_riqi_qiantian . " 00:00:00' "; $where["str"] = $query_str; $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(); //echo(json_encode($where)); $total = count($total_rs); $jieshu_time = $total_rs[$page_size * $page - $page_size][tm]; if ($page_size * $page > $total) { $kaishi_time = $total_rs[$total - 1][tm]; } else { $kaishi_time = $total_rs[$page_size * $page - 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")->order(array("s.tm" => "desc"))->select(); $Stats = array(); foreach ($Stat as &$s) { $sub_arr = array(); $s["tm"] = substr($s["tm"], 0, 10); if (array_key_exists($s["tm"], $Stats)) { $sub_arr = $Stats[$s["tm"]]; } array_push($sub_arr, $s); $Stats[$s["tm"]] = $sub_arr; // $where["s.tm"] = $s["tm"]; // $where["s.key"] = "register"; // $table = new FTable("Stat","s",FDB::$DB_MUMU_STAT); // $data = $table->fields(array("sum(s.value) as sum" )) ->where($where)->find(); // $s["register"] = $data["sum"]; // // // if ($stats_key) { $where["s.key"] = $stats_key1; } // $table1 = new FTable("Stat","s",FDB::$DB_MUMU_STAT); // $data1 = $table1->fields(array("sum(s.value) as sum" )) ->where($where)->find(); // $s["stats_key1"] = $data1["sum"]; // if ($stats_key) { $where["s.key"] = $stats_key2; } // $table2 = new FTable("Stat","s",FDB::$DB_MUMU_STAT); // $data2 = $table2->fields(array("sum(s.value) as sum" )) ->where($where)->find(); // $s["stats_key2"] = $data2["sum"]; // if ($stats_key) { $where["s.key"] = $stats_key3; } // $table3 = new FTable("Stat","s",FDB::$DB_MUMU_STAT); // $data3 = $table3->fields(array("sum(s.value) as sum")) ->where($where)->find(); // $s["stats_key3"] = $data3["sum"]; // if ($stats_key) { $where["s.key"] = $stats_key4; } // $table4 = new FTable("Stat","s",FDB::$DB_MUMU_STAT); // $data4 = $table4->fields(array("sum(s.value) as sum")) ->where($where)->find(); // $s["stats_key4"] = $data4["sum"]; // if ($stats_key) { $where["s.key"] = $stats_key5; } // $table5 = new FTable("Stat","s",FDB::$DB_MUMU_STAT); // $data5 = $table5->fields(array("sum(s.value) as sum")) ->where($where)->find(); // $s["stats_key5"] = $data5["sum"]; // if ($stats_key) { $where["s.key"] = $stats_key6; } // $table6 = new FTable("Stat","s",FDB::$DB_MUMU_STAT); // $data6 = $table6->fields(array("sum(s.value) as sum")) ->where($where)->find(); // $s["stats_key6"] = $data6["sum"]; // if ($stats_key) { $where["s.key"] = $stats_key7; } // $table7 = new FTable("Stat","s",FDB::$DB_MUMU_STAT); // $data7 = $table7->fields(array("sum(s.value) as sum")) ->where($where)->find(); // $s["stats_key7"] = $data7["sum"]; // if ($stats_key) { $where["s.key"] = $stats_key15; } // $table15 = new FTable("Stat","s",FDB::$DB_MUMU_STAT); // $data15 = $table15->fields(array("sum(s.value) as sum")) ->where($where)->find(); // $s["stats_key15"] = $data15["sum"]; // if ($stats_key) { $where["s.key"] = $stats_key30; } // $table30 = new FTable("Stat","s",FDB::$DB_MUMU_STAT); // $data30 = $table30->fields(array("sum(s.value) as sum")) ->where($where)->find(); // $s["stats_key30"] = $data30["sum"]; //$s["stats_date"] = substr($s["tm"],0,10); } /*print_r($Stats);*/ $Stats2 = array(); foreach ($Stats as &$s) { $sub_arr = array("tm" => "", "register" => 0, $stats_key0 => 0, $stats_key1 => 0, $stats_key2 => 0, $stats_key3 => 0, $stats_key4 => 0, $stats_key5 => 0, $stats_key6 => 0, $stats_key7 => 0, $stats_key15 => 0, $stats_key30 => 0); foreach ($s as &$s_x) { $sub_arr["tm"] = $s_x["tm"]; if ($s_x["key"] == "register") { $sub_arr["register"] = $s_x["sum"]; } if ($s_x["key"] == $stats_key0) { $sub_arr[$stats_key0] = $s_x["sum"]; } if ($s_x["key"] == $stats_key1) { $sub_arr[$stats_key1] = $s_x["sum"]; } if ($s_x["key"] == $stats_key2) { $sub_arr[$stats_key2] = $s_x["sum"]; } if ($s_x["key"] == $stats_key3) { $sub_arr[$stats_key3] = $s_x["sum"]; } if ($s_x["key"] == $stats_key4) { $sub_arr[$stats_key4] = $s_x["sum"]; } if ($s_x["key"] == $stats_key5) { $sub_arr[$stats_key5] = $s_x["sum"]; } if ($s_x["key"] == $stats_key6) { $sub_arr[$stats_key6] = $s_x["sum"]; } if ($s_x["key"] == $stats_key7) { $sub_arr[$stats_key7] = $s_x["sum"]; } if ($s_x["key"] == $stats_key15) { $sub_arr[$stats_key15] = $s_x["sum"]; } if ($s_x["key"] == $stats_key30) { $sub_arr[$stats_key30] = $s_x["sum"]; } } array_push($Stats2, $sub_arr); } //echo(json_encode($Stats2)); // $total = count($Stats); $page_info = FPager::getPagerInfo($total, $page, $page_size); $spmList = Service_Edit::getAllSpm(); $this->assign('spmarr', json_encode($spmList)); $c_names = Service_Edit::getSpmMap($spmList); $this->assign('spmList', $c_names); $this->assign('page_info', $page_info); $this->assign('Stat', $Stats2); $this->assign('stats_key', $stats_key); $this->assign('sc_uid', $c_uid); $this->assign('user_gender', $user_gender); $this->assign('stats_date', $stats_date); $this->assign('stats_key0', $stats_key0); $this->assign('stats_key1', $stats_key1); $this->assign('stats_key2', $stats_key2); $this->assign('stats_key3', $stats_key3); $this->assign('stats_key4', $stats_key4); $this->assign('stats_key5', $stats_key5); $this->assign('stats_key6', $stats_key6); $this->assign('stats_key7', $stats_key7); $this->assign('stats_key15', $stats_key15); $this->assign('stats_key30', $stats_key30); $this->display('admin/stats_liucun'); }
public function beforeAction() { global $_F; // $_F["debug"] = true; // phpinfo();exit; // if ($_GET['session_id']) { //// session_destroy(); // session_write_close(); // // session_id($_GET['session_id']); // session_start(); // } $_F['domain'] = "/"; $setting_keys = array('www_url', 'static_url'); $settings = Service_Setting::get($setting_keys); $_F['s_url'] = $settings['static_url'] ? trim($settings['static_url'], '/') : ''; $_F['www_url'] = $settings['www_url']; if ($_F['controller'] != 'Controller_Admin_Auth' && ($_F['controller'] != 'Controller_Admin_Video' && $_F['action'] != 'quickAdd')) { $this->checkAuth(); } if (!$_F['permits']['admin']) { return $this->error('没有 ADMIN 权限'); } $menuInit = FRequest::getString('menu'); $query = $_SERVER['REQUEST_URI']; //echo($query); $left = explode("/", $query); $left = "/" . $left[1] . "/" . $left[2] . "/"; //$query_str= " url like '%".$left."%' "; //$where["str"] = " name like %".$left."% "; if ($menuInit || $query == "/" || $query == "/admin") { $menuInit = explode('/', $menuInit); if (!$menuInit[0] || $query == "/" || $query == "/admin") { $menuInit[0] = 'default'; } } else { $where = array(); $where["url"] = array('like' => $left); $left_menus_table = new FTable("left_menus"); $left_menus1 = $left_menus_table->fields(array("top_menus_id"))->where($where)->find(); $top_menus_table = new FTable("top_menus"); $top_menus1 = $top_menus_table->fields(array("name", "id", "menu"))->where(array("id" => $left_menus1['top_menus_id']))->find(); $menuInit[0] = $top_menus1['menu']; //echo($menuInit[0]); } //echo($menuInit[0]); $top_menus = Service_Menus::getTopMenus(); $menuItems = Service_Menus::getLeftMenus($menuInit[0]); $query = $_SERVER['REQUEST_URI']; $this->assign('top_menus', $top_menus); $this->assign('menuItems', $menuItems); //echo(FRequest::getString('menu')); if (FRequest::getString('menu')) { $top_class = "sidebar-left-opened"; } else { $top_class = ""; } //echo($top_class); $this->assign('top_class', $top_class); $this->assign('menu', $menuInit[0]); $this->assign('left', $left); return true; }
/** * 添加焦点图 */ function addAction() { $type = FRequest::getString('type'); $this->assign('type', $type); if ($this->isPost()) { $text = FRequest::getPostString('text'); $pic = FRequest::getPostString('pic'); $anniu_caozuo = FRequest::getPostInt('anniu_caozuo'); $events_id = FRequest::getPostInt('events_id'); $type = FRequest::getPostString('type'); $position = CommonUtil::getComParam(FRequest::getPostInt('position'), 0); if (!$pic) { $this->showMessage("图片不能为空", error); return; } //打开网页 $url = FRequest::getPostString('url'); //打开游戏 $gid = FRequest::getPostString('gid'); $area_id = FRequest::getPostString('area_id'); $buts = array(); if ($anniu_caozuo == 1) { $data = array("url" => $url); if (!$url) { $this->showMessage("链接地址不能为空", error); return; } $buts = array("cmd" => "cmd_open_web", "data" => $data); } if ($anniu_caozuo == 2) { $data = array(); $buts = array("cmd" => "cmd_open_actlist", "data" => $data); } if ($anniu_caozuo == 3) { $data = array("id" => $events_id); $buts = array("cmd" => "cmd_open_act", "data" => $data); } if ($anniu_caozuo == 4) { $data = array(); $buts = array("cmd" => "cmd_open_actaward", "data" => $data); } if ($anniu_caozuo == 5) { $data = array("gid" => $gid, "area_id" => $area_id); $buts = array("cmd" => "cmd_entry_game", "data" => $data); } $text = str_replace("<p>", "", $text); $text = str_replace("</p>", "<br>", $text); $action = self::decodeUnicode(json_encode($buts)); //print_r($content); $data2 = array('type' => $type, 'text' => $text, 'pic' => $pic, 'action' => $action, 'position' => $position, 'status' => 1); $events_table = new FTable("focus"); $events_table->insert($data2); $this->showMessage("添加成功", "success", "/FocusList/list?type=" . $type . ""); return; } $this->display('admin/focus_add'); }
function list2Action() { $uid = FRequest::getInt("uid"); $page = max(1, FRequest::getInt('page')); $gender = FRequest::getInt('gender'); $province = FRequest::getString('province'); $city = FRequest::getString('city'); $this->assign("province", $province); $this->assign("city", $city); $where = array(); if ($uid > 0) { $where["um.uid"] = $uid; } else { $query_str = " ur.item <> 'all' "; $where["ur.status"] = 0; $query_str = $query_str . " and ur.uid >= '5000000' "; if ($city == "长沙") { $where["ud.city"] = $city; } if ($city == "北京") { $where["ud.city"] = $city; } if ($city == "非长沙") { $query_str = $query_str . " and ud.city<>'长沙'"; } $where["str"] = $query_str; } if ($gender) { $where["um.gender"] = $gender; } if ($uid > 0) { $table = new FTable("user_main", "um"); $users = $table->fields(array("um.uid", "um.gender", "um.reg_time", "ud.nickname", "ud.avatar", "ud.province", "ud.city", "ud.age", "ud.height", "ud.marry", "ud.aboutme", "ud.workarea", "ud.job", "ud.interest", "ud.birthday", "ud.workplaceid"))->leftJoin("user_detail", "ud", "um.uid=ud.uid")->where($where)->page($page)->limit(20)->select(); } else { $table = new FTable("update_record", "ur"); $users = $table->fields(array("um.uid", "um.gender", "um.reg_time", "ud.nickname", "ud.avatar", "ud.province", "ud.city", "ud.age", "ud.height", "ud.marry", "ud.aboutme", "ud.workarea", "ud.job", "ud.interest", "ud.birthday", "ud.workplaceid"))->leftJoin("user_main", "um", "ur.uid=um.uid")->leftJoin("user_detail", "ud", "um.uid=ud.uid")->where($where)->page($page)->limit(20)->groupBy("ur.uid")->order(array("ur.id" => "asc"))->select(); $table = new FTable("update_record", "ur"); $user_messages2 = $table->fields(array("um.uid"))->leftJoin("user_main", "um", "ur.uid=um.uid")->leftJoin("user_detail", "ud", "um.uid=ud.uid")->where($where)->groupBy("ur.uid")->select(); $total = count($user_messages2); } foreach ($users as &$user) { //$user["avatar"] = CommonUtil::getMoreSizeImg($user["avatar"],200,200); $user["age"] = CommonUtil::birthdayToAge($user["birthday"]); $dynamics = new FTable("dynamics"); $dynamic = $dynamics->fields(array("count(*) as count"))->where(array("uid" => $user["uid"], "str" => " status in (2,3,4) "))->select(); $user["dynamics"] = $dynamic[0]['count']; $photo_table = new FTable("user_photo_album"); $photos_o = $photo_table->fields(array("pic", "albumid"))->where(array("uid" => $user["uid"], "str" => " pic <> '" . $user["avatar"] . "'"))->select(); $photos = array(); foreach ($photos_o as &$p) { $p["pic"] = CommonUtil::getMoreSizeImg($p["pic"], 150, 150); array_push($photos, $p); } $user["photo_arr"] = $photos; $update_record = new FTable("update_record"); $updates = $update_record->fields(array("item"))->where(array("uid" => $user["uid"], "status" => 0))->select(); $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)) { $user["nicknamecss"] = "red"; } if (in_array("avatar", $update_arr)) { $user["avatarcss"] = "red"; } if (in_array("aboutme", $update_arr)) { $user["aboutmecss"] = "red"; } $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"] . "' "))->select(); $i = 1; foreach ($images as $image) { $table4 = new FTable("user_detail", "ud"); $users4 = $table4->fields(array("ud.uid"))->where(array("ud.avatar" => $image['url']))->find(); if ($users4) { $i++; $uid_d = $uid_d . "," . $users4['uid']; } } $user["avatar"] = CommonUtil::getMoreSizeImg($user["avatar"], 150, 150); $user["uid_d"] = $uid_d; $user["uid_i"] = $i; } if ($uid > 0) { $page_info = $table->getPagerInfo(); } else { $page_info = FPager::getPagerInfo($total, $page, 20); } $this->assign('page_info', $page_info); $this->assign("users", $users); $this->assign("uid", $uid); $this->assign('gender', $gender); $this->display('admin/y_user_list2'); }
function listAction() { //global $_F; //$_F["debug"] = true; $uid = CommonUtil::getDefStr(FRequest::getPostString('uid'), ""); $tj25 = json_decode(FRequest::getPostString('tj25')); $tj26 = json_decode(FRequest::getPostString('tj26')); $tj27 = json_decode(FRequest::getPostString('tj27')); $tj28 = json_decode(FRequest::getPostString('tj28')); $tj30 = json_decode(FRequest::getPostString('tj30')); $tj31 = json_decode(FRequest::getPostString('tj31')); $tj32 = json_decode(FRequest::getPostString('tj32')); $stats_date = FRequest::getString('stats_date'); if (!$stats_date) { $this->showMessage("请输入统计日期", error); return; } $url = FConfig::get('global.service_mumu_url') . "/user/AdminTjInfo"; /* $params = array("uid"=>$uid,"date"=>$stats_date); $params=Service_Common::post($url,json_encode($params)); $params=json_decode($params); if($params->status=="ok"){ $this->assign("tj",$params->res); } else{ $this->showMessage("查找失败",$messageType = 'success'); return; }*/ if (!$uid || $uid == 25) { $params25 = array("uid" => 25, "date" => $stats_date); $params25 = Service_Common::post($url, json_encode($params25)); $params25 = json_decode($params25); if ($params25->status == "ok") { $tj25 = $params25->res; } } if (!$uid || $uid == 26) { $params26 = array("uid" => 26, "date" => $stats_date); $params26 = Service_Common::post($url, json_encode($params26)); $params26 = json_decode($params26); if ($params26->status == "ok") { $tj26 = $params26->res; } } if (!$uid || $uid == 27) { $params27 = array("uid" => 27, "date" => $stats_date); $params27 = Service_Common::post($url, json_encode($params27)); $params27 = json_decode($params27); if ($params27->status == "ok") { $tj27 = $params27->res; } } if (!$uid || $uid == 28) { $params28 = array("uid" => 28, "date" => $stats_date); $params28 = Service_Common::post($url, json_encode($params28)); $params28 = json_decode($params28); if ($params28->status == "ok") { $tj28 = $params28->res; } } if (!$uid || $uid == 30) { $params30 = array("uid" => 30, "date" => $stats_date); $params30 = Service_Common::post($url, json_encode($params30)); $params30 = json_decode($params30); if ($params30->status == "ok") { $tj30 = $params30->res; } } if (!$uid || $uid == 31) { $params31 = array("uid" => 31, "date" => $stats_date); $params31 = Service_Common::post($url, json_encode($params31)); $params31 = json_decode($params31); if ($params31->status == "ok") { $tj31 = $params31->res; } } if (!$uid || $uid == 32) { $params32 = array("uid" => 32, "date" => $stats_date); $params32 = Service_Common::post($url, json_encode($params32)); $params32 = json_decode($params32); if ($params32->status == "ok") { $tj32 = $params32->res; } } $this->assign("tj25", $tj25); $this->assign("tj26", $tj26); $this->assign("tj27", $tj27); $this->assign("tj28", $tj28); $this->assign("tj30", $tj30); $this->assign("tj31", $tj31); $this->assign("tj32", $tj32); $this->assign("tj25_jd", json_encode($tj25)); $this->assign("tj26_jd", json_encode($tj26)); $this->assign("tj27_jd", json_encode($tj27)); $this->assign("tj28_jd", json_encode($tj28)); $this->assign("tj30_jd", json_encode($tj30)); $this->assign("tj31_jd", json_encode($tj31)); $this->assign("tj32_jd", json_encode($tj32)); $this->assign("uid", $uid); $this->assign("stats_date", $stats_date); $this->display('admin/uidtj_list'); }
/** * 验证token是否有效 */ public function valid() { if ($this->checkSignature()) { exit(FRequest::getString('echostr')); } }
/** * 进行临时统计 */ public function doTempReportAction() { $time_str = date("Y-m-d"); $stm = date('Y-m-d 00:00:00', strtotime($time_str)); $time = FRequest::getString("time"); if (CommonUtil::parmIsEmpty($time)) { $time = $stm; } // $time = "2014-11-15 00:00:00"; $sql = "select count(*) as count from user where reg_time > '" . $time . "' "; // 注册人数 $sql2 = "select count(*) as count from user where reg_time > '" . $time . "' and cell_phone>0"; // 注册绑定 $sql3 = "select count(*) as count from user where reg_time > '" . $time . "' and cell_phone>0 and common_status = 1 "; // 注帮领 $sql4 = "select count(*) as count from user where reg_time > '" . $time . "' and cell_phone>0 and common_status = 1 and rename_reward = 2 "; $sql5 = "select count(*) as count from user where reg_time > '" . $time . "' and cell_phone>0 and common_status = 1 and addpic_reward = 2 "; $sql6 = "select count(distinct uid) as count from bid where uid in (select uid from user where reg_time>'" . $time . " and cell_phone>0 and common_status = 1') "; // 领出价 $sql7 = "select count(*) as count from user where reg_time > '" . $time . "' and addpic_reward = 2 "; $sql8 = "select count(*) as count from user where reg_time > '" . $time . "' and rename_reward = 2 "; $sql9 = "select count(distinct uid) as count from bid where uid in (select uid from user where reg_time>'" . $time . "') "; // 领出价 $reg_data = FDB::fetch($sql); $reg_bind_data = FDB::fetch($sql2); $reg_bind_ling = FDB::fetch($sql3); $reg_b_l_rename = FDB::fetch($sql4); $reg_b_l_addpic = FDB::fetch($sql5); $reg_b_l_bid = FDB::fetch($sql6); $reg_rename = FDB::fetch($sql7); $reg_addpic = FDB::fetch($sql8); $reg_bid = FDB::fetch($sql9); $reg_b_l_name_num = $reg_b_l_rename[0]["count"]; $reg_b_l_num = $reg_bind_ling[0]["count"]; $reg_b_l_pic_num = $reg_b_l_addpic[0]["count"]; $reg_b_l_bid_num = $reg_b_l_bid[0]["count"]; echo "注册人数 :" . $reg_data[0]["count"] . " <br>"; echo "注册绑定人数 :" . $reg_bind_data[0]["count"] . " <br>"; echo "注册绑定领取礼包人数 :" . $reg_b_l_num . " <br>"; echo "注改昵称 :" . $reg_rename[0]["count"] . " <br>"; echo "注该头像 :" . $reg_addpic[0]["count"] . " <br>"; echo "注册出价 :" . $reg_bid[0]["count"] . " <br>"; echo "注绑领改昵称 :" . $reg_b_l_name_num . " ----- " . sprintf("%.2f", $reg_b_l_name_num * 100 / $reg_b_l_num) . "% <br>"; echo "注绑领改头像 :" . $reg_b_l_pic_num . " ----- " . sprintf("%.2f", $reg_b_l_pic_num * 100 / $reg_b_l_num) . "% <br>"; echo "注绑领出价 :" . $reg_b_l_bid[0]["count"] . " ----- " . sprintf("%.2f", $reg_b_l_bid_num * 100 / $reg_b_l_num) . "% <br>"; }
function messageDateAction() { // $datetime_zuotian = date("Y-m-d ", time() - 86400); // $datetime_jintian = date("Y-m-d ", time()); $datetime_jintian = FRequest::getString("datetime_jintian"); if (!$datetime_jintian) { $datetime_jintian = date("Y-m-d ", time()); } if ($datetime_jintian) { //$datetime_jintian = "2015-07-04"; //$datetime_jintian = date("Y-m-d ", time()); $datetime_zuotian = date("Y-m-d", strtotime("{$datetime_jintian} - 1 days")); $datetime_qitian = date("Y-m-d ", strtotime("{$datetime_jintian} - 7 days")); $query_str_7 = " tm < '" . $datetime_qitian . " 00:00:00' "; $where = array(); $users = array(); $query_str = " mm.from>'5000000' and mm.tm >= '" . $datetime_zuotian . " 00:00:00' and mm.tm < '" . $datetime_jintian . " 00:00:00' and mm.type in ('text','pic','voice') "; //$query_str = " 1=1"; $useradds = new FTable('user_message_7'); $useradds->where(array('str' => $query_str_7))->remove(true); $where["str"] = $query_str; $table = new FTable("message", "mm", FDB::$DB_MUMU_MESSAGE); $user_messages = $table->fields(array("mm.from", "mm.tm"))->where($where)->groupBy("mm.from")->select(); foreach ($user_messages as $user_message) { $data2 = array('uid' => $user_message['from'], 'tm' => $user_message['tm']); $user_detail_table = new FTable("user_message_7"); $user_detail_table->insert($data2); } $table = new FTable("tag_message", "mm", FDB::$DB_MUMU_MESSAGE); $user_messages = $table->fields(array("mm.from", "mm.tm"))->where($where)->groupBy("mm.from")->select(); foreach ($user_messages as $user_message) { $data2 = array('uid' => $user_message['from'], 'tm' => $user_message['tm']); $user_detail_table = new FTable("user_message_7"); $user_detail_table->insert($data2); } } }