Esempio n. 1
0
 /**
  * 某商品结果(二维码,密码)
  * @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');
 }
Esempio n. 2
0
 /**
  * 修改
  */
 function updateAction()
 {
     $id = FRequest::getInt("id");
     if ($this->isPost()) {
         $text = FRequest::getPostString('text');
         $pic = FRequest::getPostString('pic');
         $riqi = date("Y-m-d", time());
         $title = FRequest::getPostString('title');
         if (!$pic) {
             $this->showMessage("图片不能为空", error);
             return;
         }
         if (!$title) {
             $this->showMessage("标题不能为空", error);
             return;
         }
         $data2 = array('title' => $title, 'text' => $text, 'pic' => $pic, 'riqi' => $riqi);
         $mumu_ba_table = new FTable("mumu_ba");
         $mumu_ba_table->where(array("id" => $id))->update($data2);
         $this->showMessage("修改成功", "success", "/MumuBa/list");
         return;
     }
     $mumu_ba_table = new FTable("mumu_ba");
     $mumu_ba = $mumu_ba_table->where(array('id' => $id))->find();
     $this->assign("mumu_ba", $mumu_ba);
     $this->assign("id", $id);
     $this->display('admin/mumu_ba_update');
 }
Esempio n. 3
0
 /**
  * 修改焦点图
  */
 function updateAction()
 {
     $id = FRequest::getInt("id");
     if ($this->isPost()) {
         $text = FRequest::getPostString('text');
         $text = str_replace("<p>", "", $text);
         $text = str_replace("</p>", "<br>", $text);
         $riqi = FRequest::getPostString('riqi');
         $title = FRequest::getPostString('title');
         if (!$title) {
             $this->showMessage("标题不能为空", error);
             return;
         }
         if (!$riqi) {
             $this->showMessage("日期不能为空", error);
             return;
         }
         $data2 = array('title' => $title, 'text' => $text, 'riqi' => $riqi);
         $guanwang_news_table = new FTable("guanwang_news");
         $guanwang_news_table->where(array("id" => $id))->update($data2);
         $this->showMessage("修改成功", "success", "/GuanwangNews/list");
         return;
     }
     $guanwang_news_table = new FTable("guanwang_news");
     $guanwang_news = $guanwang_news_table->where(array('id' => $id))->find();
     $this->assign("guanwang_news", $guanwang_news);
     $this->assign("id", $id);
     $this->display('admin/guanwang_news_update');
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
File: Spm.php Progetto: jiatower/php
 public function deleteAction()
 {
     $spmT = new FTable('stats_spm');
     $auto_id = FRequest::getInt('id');
     $spmT->where(array('id' => $auto_id))->remove(true);
     FResponse::redirect('r');
 }
Esempio n. 6
0
 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');
 }
Esempio n. 7
0
 public function deleteAction()
 {
     $top_menus = new FTable('top_menus');
     $topid = FRequest::getInt('topid');
     $top_menus->where(array('id' => $topid))->remove(true);
     FResponse::redirect('r');
 }
Esempio n. 8
0
 /**
  * 修改焦点图
  */
 function updateAction()
 {
     $id = FRequest::getInt("id");
     if ($this->isPost()) {
         $text = FRequest::getPostString('text');
         $pic = FRequest::getPostString('pic');
         $url = FRequest::getPostString('url');
         $title = FRequest::getPostString('title');
         $position = CommonUtil::getComParam(FRequest::getPostInt('position'), 0);
         if (!$pic) {
             $this->showMessage("图片不能为空", error);
             return;
         }
         if (!$title) {
             $this->showMessage("标题不能为空", error);
             return;
         }
         $data2 = array('title' => $title, 'text' => $text, 'pic' => $pic, 'url' => $url, 'position' => $position);
         $mumu_youxi_table = new FTable("mumu_youxi");
         $mumu_youxi_table->where(array("id" => $id))->update($data2);
         $this->showMessage("修改成功", "success", "/MumuYouxi/list");
         return;
     }
     $mumu_youxi_table = new FTable("mumu_youxi");
     $mumu_youxi = $mumu_youxi_table->where(array('id' => $id))->find();
     $this->assign("mumu_youxi", $mumu_youxi);
     $this->assign("id", $id);
     $this->display('admin/mumu_youxi_update');
 }
Esempio n. 9
0
 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');
 }
Esempio n. 10
0
 public function defaultAction()
 {
     //global $_F;
     //$_F["debug"] = true;
     $id = FRequest::getInt('id');
     $this->assign('id', $id);
     $this->display('shareDynamic');
 }
Esempio n. 11
0
 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');
 }
Esempio n. 12
0
 public function chexiaoAction()
 {
     //global $_F;
     // $_F["debug"] = true;
     $tid = FRequest::getInt('tid');
     $priority = FRequest::getPostInt('priority');
     $discovery_table = new FTable("discovery", "mmd", FDB::$DB_MUMU_SORT);
     $discovery_table->where(array("tid" => $tid))->update(array("priority" => "0"));
     echo "<script LANGUAGE='javascript'> document.getElementById('priority_" . $tid . "').value=0;</script>";
     $this->showMessage("撤销成功", "success");
     return;
 }
Esempio n. 13
0
 public function logAction()
 {
     global $_F;
     $page = FRequest::getInt('page');
     $actionLogTable = new FTable('auction_log');
     $where = array('status' => 1);
     $actionList = $actionLogTable->where($where)->page($page)->limit(50)->select();
     $pagerInfo = $actionLogTable->getPagerInfo();
     $this->assign('page_info', $pagerInfo);
     $this->assign('auction_logs', $actionList);
     $this->display('admin/auction-log');
 }
Esempio n. 14
0
 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');
 }
Esempio n. 15
0
 public function modifyAction()
 {
     if ($this->isPost()) {
         $group = $_POST['group'];
         $result = $this->db_group->update($group, array('gid' => $_POST['gid']));
         if ($result) {
             return $this->success('修改成功!', '/admin/group/list');
         }
     }
     $action = 'modify';
     $this->assign('action', $action);
     $where = array('gid' => FRequest::getInt('gid'));
     $group_info = $this->db_group->where($where)->find();
     $this->assign('group_info', $group_info);
     $this->display('admin/group-add');
 }
Esempio n. 16
0
 /**
  * 图片检测接口
  * 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());
 }
Esempio n. 17
0
 public function shenheAction()
 {
     //global $_F;
     // $_F["debug"] = true;
     $id = FRequest::getInt('id');
     $picslevel = FRequest::getPostInt('picslevel');
     $topic_table = new FTable("topic");
     $topic_table->where(array('id' => $id))->update(array("picslevel" => $picslevel));
     $params = array("tid" => "200");
     $params = json_encode($params);
     $url = FConfig::get('global.service_mumu_url') . "/topic/ClearCache";
     $params = Service_Common::post($url, $params);
     $params = json_decode($params);
     if ($params->status == "ok") {
         $this->showMessage("审核成功", $messageType = 'success');
     } else {
         $this->showMessage("审核失败", $messageType = 'success');
     }
     return;
 }
Esempio n. 18
0
 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');
 }
Esempio n. 19
0
 /**
  * 修改活动
  */
 function updateAction()
 {
     $id = FRequest::getInt("id");
     if ($this->isPost()) {
         $text = FRequest::getPostString('text');
         $textlong = FRequest::getPostString('textlong');
         $pic = FRequest::getPostString('pic');
         $picda = FRequest::getPostString('picda');
         $tip = FRequest::getPostString('tip');
         $anniu_caozuo = FRequest::getPostInt('anniu_caozuo');
         $timeout = FRequest::getPostString('timeout');
         if (!$text) {
             $this->showMessage("活动标题不能为空", error);
             return;
         }
         if (!$textlong) {
             $this->showMessage("活动内容不能为空", error);
             return;
         }
         if (!$pic) {
             $this->showMessage("活动图片不能为空", error);
             return;
         }
         if (!$tip) {
             $this->showMessage("按钮文字不能为空", error);
             return;
         }
         $textlong = str_replace("<p>", "", $textlong);
         $textlong = str_replace("</p>", "<br>", $textlong);
         //打开网页
         $url = FRequest::getPostString('url');
         //打开圈子
         $topic_id = FRequest::getPostString('topic_id');
         //打开游戏
         $gid = FRequest::getPostString('gid');
         $area_id = FRequest::getPostString('area_id');
         $buts = array();
         $buts[0] = array("tip" => "忽略", "cmd" => "cmd_close", "def" => false);
         if ($anniu_caozuo == 1) {
             $data = array("url" => $url);
             if (!$url) {
                 $this->showMessage("链接地址不能为空", error);
                 return;
             }
             $buts[1] = array("tip" => $tip, "cmd" => "cmd_open_web", "def" => true, "data" => $data);
         }
         if ($anniu_caozuo == 2) {
             $data = array("tid" => $topic_id);
             if (!$topic_id) {
                 $this->showMessage("圈子话题ID不能为空", error);
                 return;
             }
             $buts[1] = array("tip" => $tip, "cmd" => "cmd_open_topic", "def" => true, "data" => $data);
         }
         if ($anniu_caozuo == 3) {
             $data = array("gid" => $gid, "area_id" => $area_id);
             $buts[1] = array("tip" => $tip, "cmd" => "cmd_entry_game", "def" => true, "data" => $data);
         }
         $content = array("text" => $textlong, "pic" => $picda, "buts" => $buts);
         $content = self::decodeUnicode(json_encode($content));
         //print_r($content);
         $data2 = array('title' => $text, 'pic' => $pic, 'timeout' => $timeout . ":00", 'content' => $content);
         if ($picda) {
             $data2["style"] = 2;
         } else {
             $data2["style"] = 1;
         }
         $events_table = new FTable("events");
         $events_table->where(array("id" => $id))->update($data2);
         $this->showMessage("修改活动成功", "success", "/EventsList/list");
         return;
     }
     $events_table = new FTable("events");
     $events = $events_table->where(array('id' => $id))->find();
     $events["content"] = json_decode($events["content"]);
     $events["timeout"] = substr($events["timeout"], 0, -3);
     $this->assign("events", $events);
     $this->assign("id", $id);
     $this->display('admin/events_update');
 }
Esempio n. 20
0
 public function deleteAction()
 {
     $useradds = new FTable('user_address');
     $addrid = FRequest::getInt('addrid');
     $useradds->where(array('addrid' => $addrid))->remove(true);
     FResponse::redirect('r');
 }
Esempio n. 21
0
File: App.php Progetto: jiatower/php
 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;
 }
Esempio n. 22
0
 function levelAction()
 {
     $page = max(1, FRequest::getInt('page'));
     $uid = FRequest::getInt('uid');
     $where = array();
     if ($uid) {
         $where["usl.uid"] = $uid;
     }
     $table = new FTable("user_star_level", "usl");
     $user_messages = $table->fields(array("usl.uid", "usl.level", "um.gender", "ud.nickname", "ud.avatar"))->leftJoin("user_main", "um", "um.uid=usl.uid")->leftJoin("user_detail", "ud", "ud.uid=usl.uid")->where($where)->page($page)->limit(20)->order(array("usl.tm" => "desc"))->select();
     foreach ($user_messages as &$user_message) {
         $user_message['avatar'] = CommonUtil::getMoreSizeImg($user_message['avatar'], 222, 222);
         $photo_table = new FTable("user_photo_album");
         $photos = $photo_table->fields(array("pic"))->where(array("uid" => $user_message['uid']))->limit(3)->select();
         $photo_arr = array();
         foreach ($photos as $photo) {
             array_push($photo_arr, CommonUtil::getMoreSizeImg($photo["pic"], 222, 222));
         }
         $user_message['photo_arr'] = $photo_arr;
     }
     $page_info = $table->getPagerInfo();
     $this->assign('page_info', $page_info);
     $this->assign('users', $user_messages);
     $this->display('admin/user_xingji_level_list');
 }
Esempio n. 23
0
 public function editAction()
 {
     if (FRequest::isPost()) {
         $manager = $_POST['manager'];
         $id = FRequest::getPostInt('id');
         $password = FRequest::getPostString('password');
         if ($password) {
             $manager['password'] = md5($password);
         }
         $quanxianid = FRequest::getPostString('quanxianid');
         $quanxianidx = FRequest::getPostString('quanxianidx');
         if ($quanxianid && count($quanxianid) > 0) {
             $top_menus_id = implode(",", $quanxianid);
         }
         if ($quanxianidx && count($quanxianidx) > 0) {
             $left_menus_id = implode(",", $quanxianidx);
         }
         $manager['top_menus_id'] = $top_menus_id;
         $manager['left_menus_id'] = $left_menus_id;
         $result = $this->db_manager->update($manager, array('uid' => $_POST['id']));
         if ($result) {
             return $this->success('修改成功!', '/admin/manager/list');
         } else {
             return $this->error("342");
         }
     } else {
         $uid = FRequest::getInt('uid');
         $status = array('启用' => '1', '禁用' => '0');
         //获取用户组
         $group = array();
         $manager_group = $this->db_manager_group->select();
         foreach ($manager_group as $v) {
             $group[$v['name']] = $v['gid'];
         }
         $this->assign('group', $group);
         $this->assign('status', $status);
         $action = 'add';
         if ($uid) {
             $action = 'edit';
             $where = array('uid' => $uid);
             $manager = $this->db_manager->where($where)->find();
             $this->assign('manager', $manager);
         }
         /*$top_menus_table = new FTable("top_menus");
                     $top_menus = $top_menus_table->fields(array("name","id"))->select();
         
                     foreach($top_menus as &$top_menu){
         
                         $left_menus_table = new FTable("left_menus");
                         $left_menus = $left_menus_table->fields(array("name","id"))->where(array("top_menus_id"=>$top_menu["id"]))->select();
                         $top_menu["left_menus"]=$left_menus;
         
                     }
                     // echo(json_encode($top_menus));
                     $this->assign('top_menus',$top_menus);*/
         $top_menus_ids = explode(",", $manager['top_menus_id']);
         $left_menus_ids = explode(",", $manager['left_menus_id']);
         $top_menus_table = new FTable("top_menus");
         $top_menus = $top_menus_table->fields(array("name", "id"))->select();
         foreach ($top_menus as &$top_menu) {
             $isin = in_array($top_menu['id'], $top_menus_ids);
             if ($isin) {
                 $top_menu["checked"] = "checked";
             } else {
                 $top_menu["checked"] = "";
             }
             $left_menus_table = new FTable("left_menus");
             $left_menus = $left_menus_table->fields(array("name", "id"))->where(array("top_menus_id" => $top_menu["id"]))->select();
             foreach ($left_menus as &$left_menu) {
                 $isin = in_array($left_menu['id'], $left_menus_ids);
                 if ($isin) {
                     $left_menu["checked"] = "checked";
                 } else {
                     $left_menu["checked"] = "";
                 }
             }
             $top_menu["left_menus"] = $left_menus;
         }
         // echo(json_encode($top_menus));
         $this->assign('top_menus', $top_menus);
         $this->assign('action', $action);
         $this->display('admin/manager-add');
     }
 }
Esempio n. 24
0
 public function awardyifahuoAction()
 {
     // global $_F;
     // $_F["debug"] = true;
     $log_id = FRequest::getInt('log_id');
     $status = FRequest::getInt('status');
     $type = FRequest::getInt('type');
     $award_trans_table = new FTable("award_trans");
     $award_trans = $award_trans_table->where(array('id' => $log_id))->find();
     $this->assign("award_trans", $award_trans);
     $this->assign("log_id", $log_id);
     $this->assign("status", $status);
     $this->assign("type", $type);
     $this->display('admin/user_award_yifahuo');
 }
Esempio n. 25
0
 public function userbanAction()
 {
     // global $_F;
     // $_F["debug"] = true;
     $uid = FRequest::getInt('uid');
     $topic_table = new FTable("user_ban");
     $topic_table->where(array('uid' => $uid))->update(array("count" => "0"));
     echo "ok";
 }
Esempio n. 26
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');*/
 }
Esempio n. 27
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');
 }
Esempio n. 28
0
 /**
  * 按时间地区在线人数
  */
 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');
 }
Esempio n. 29
0
 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');
 }
Esempio n. 30
0
 /**
  * 修改焦点图
  */
 function updateAction()
 {
     $id = FRequest::getInt("id");
     $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');
         $type = FRequest::getPostString('type');
         $position = CommonUtil::getComParam(FRequest::getPostInt('position'), 0);
         $events_id = FRequest::getPostInt('events_id');
         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);
         $events_table = new FTable("focus");
         $events_table->where(array("id" => $id))->update($data2);
         $this->showMessage("修改成功", "success", "/FocusList/list?type=" . $type . "");
         return;
     }
     $focus_table = new FTable("focus");
     $focus = $focus_table->where(array('id' => $id))->find();
     $focus["action"] = json_decode($focus["action"]);
     $this->assign("focus", $focus);
     $this->assign("id", $id);
     $this->display('admin/focus_update');
 }