Ejemplo n.º 1
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.º 2
0
 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');*/
 }