Ejemplo n.º 1
0
 /**
  * 主报表查询
  */
 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');
 }
Ejemplo n.º 2
0
 /**
  * 约会说明
  */
 public function dateAction()
 {
     global $_F;
     //$_F["debug"] = true;
     $uid = FCookie::get("uid");
     $user = Service_Client::getUserByUid($uid);
     if ($user["province"] == "北京" || $user["province"] == "天津" || $user["province"] == "上海" || $user["province"] == "重庆") {
         $user["city"] = $user["province"];
     }
     $table = new FTable("date_place");
     $place_num = $table->where(array("city" => $user["city"]))->count();
     $table = new FTable("date_request", "dr");
     $query_sql = " ( ud.province = '" . $user["city"] . "' or  ud.city = '" . $user["province"] . "' )";
     $date_num = $table->leftJoin("user_detail", "ud", "dr.uid1=ud.uid")->where(array("dr.available" => 1, "str" => $query_sql))->count();
     $this->assign("base_url", FConfig::get('global.base_url'));
     $this->assign("place_num", $place_num);
     $this->assign("user", $user);
     $this->assign("date_num", $date_num);
     $this->display('client_date');
 }
Ejemplo n.º 3
0
 /**
  * 审核用户详情
  */
 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');
 }
Ejemplo n.º 4
0
 /**
  * 根据用户uid
  * @param $uid
  * @return array
  * @throws Exception
  */
 public static function getUserByUid($uid)
 {
     $table = new FTable("user_main", "um");
     $user = $table->leftJoin("user_detail", "ud", "um.uid=ud.uid")->where(array("um.uid" => $uid))->find();
     return $user;
 }
Ejemplo n.º 5
0
 /**
  * 秋千帐号详细
  */
 function xiangxiAction()
 {
     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();
     $this->assign("user", $user[0]);
     $interests = explode(",", $user[0]["interest"]);
     $photo_table = new FTable("user_photo_album");
     $photos = $photo_table->fields(array("pic"))->where(array("uid" => $uid))->select();
     $photo_arr = array();
     foreach ($photos as $photo) {
         array_push($photo_arr, $photo["pic"]);
     }
     $this->assign("photos", $photo_arr);
     $this->assign("old_interests", $interests);
     $this->display('admin/user_xiangxi');
 }