示例#1
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');
 }
示例#2
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');
 }
示例#3
0
文件: Mall.php 项目: jiatower/php
 /**
  * 某商品结果(二维码,密码)
  * @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');
 }
示例#4
0
文件: TopMenus.php 项目: jiatower/php
 public function deleteAction()
 {
     $top_menus = new FTable('top_menus');
     $topid = FRequest::getInt('topid');
     $top_menus->where(array('id' => $topid))->remove(true);
     FResponse::redirect('r');
 }
示例#5
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');
 }
示例#6
0
文件: Spm.php 项目: 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');
 }
示例#7
0
文件: MumuBa.php 项目: jiatower/php
 /**
  * 修改
  */
 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');
 }
示例#8
0
文件: Stats.php 项目: jiatower/php
 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);
 }
示例#9
0
 public static function dispatch()
 {
     global $_F;
     self::init();
     if (!$_F['controller'] || !$_F['action']) {
         if (F_RUN_MODE == 'sync') {
             return false;
         }
         throw new Exception("访问路径不正确,没有找到 {$_F['uri']}", 404);
     }
     $path_info = explode('/', $_F['uri']);
     if (isset($path_info[1]) && !isset($path_info[2]) && !isset($path_info[3]) && FConfig::get("global.openDiy")) {
         $pager_table = new FTable('page');
         $pager_info = $pager_table->where("url='" . $_F['uri'] . "'")->find();
         if ($pager_info) {
             $_F['controller'] = 'Controller_Front_Public';
             $_F['default'] = $_F['action'];
             $_F['action'] = 'default';
         }
     } else {
         if (!class_exists($_F['controller'])) {
             if (F_RUN_MODE == 'sync') {
                 return false;
             }
             if ($_F['module']) {
                 $c_backup = str_replace(ucfirst($_F['module']) . '_', '', $_F['controller']);
                 if (class_exists($c_backup)) {
                     $_F['controller'] = $c_backup;
                 } else {
                     throw new Exception("找不到控制器:{$_F['controller']}", 404);
                 }
             } else {
                 throw new Exception("找不到控制器:{$_F['controller']}", 404);
             }
         }
     }
     $controller = new $_F['controller']();
     $action = $_F['action'] . 'Action';
     if (method_exists($controller, $action . "")) {
         if (method_exists($controller, 'beforeAction')) {
             // IMPORTANT beforeAction must return true
             if (!$controller->beforeAction()) {
                 return false;
             }
         }
         // 加载函数类
         require_once FLIB_ROOT . "functions/function_core.php";
         $controller->{$action}();
     } else {
         try {
             $fView = new FView();
             $fView->display();
         } catch (Exception $e) {
             throw new Exception("找不到 {$_F['action']}Action ", 404);
         }
     }
     return true;
 }
示例#10
0
文件: Auth.php 项目: jiatower/php
 public function loginAction()
 {
     global $_F;
     // $_F['debug'] = 1;
     if ($this->isPost()) {
         $username = trim($_POST['username']);
         $password = trim($_POST['password']);
         /*$checkCode = FRequest::getPostString('check_code');
         
                     if (!$checkCode) {
                         return $this->error('请输入验证码!');
                     }*/
         session_start();
         //            if ($checkCode != $_SESSION['rand_code']) {
         //                return $this->error('验证码错误!');
         //            }
         $refer = trim($_POST['refer']);
         if (strpos($refer, 'login')) {
             $refer = null;
         }
         $managerTable = new FTable('manager');
         $encryptPassword = Service_Manager::getEncryptPassword($password);
         $managerData = $managerTable->where(array('username' => $username))->find();
         $managerLoginLogTable = new FTable('manager_login_log');
         $newLoginLogData = array('username' => $username, 'login_time' => date('Y-m-d H:i:s'), 'login_ip' => FRequest::getClientIP());
         if (!$managerData) {
             $newLoginLogData['result'] = 2;
             $newLoginLogData['comment'] = '用户名不存在';
             $managerLoginLogTable->insert($newLoginLogData);
             return $this->error('用户名不存在!');
         } else {
             if ($managerData['password'] == $encryptPassword) {
                 $user_id = $managerData['user_id'];
                 // 获取管理员user_id 和 密钥
                 $user_table = new FTable("user_main");
                 $user = $user_table->where(array("uid" => $user_id))->find();
                 //                    $auth_str = md5("{$managerData['username']}|{$managerData['password']}|{$managerData['gid']}");
                 FSession::set('manager_uid', $managerData['uid']);
                 FSession::set('user_id', $user_id);
                 FSession::set('sid', $user['sid']);
                 // 更新登录时间
                 $managerTable->where(array("uid" => $managerData['uid']))->update(array('last_login_time' => date('Y-m-d H:i:s')));
                 $newLoginLogData['uid'] = $managerData['uid'];
                 $newLoginLogData['result'] = 1;
                 $managerLoginLogTable->insert($newLoginLogData);
                 //                    FCookie::set('manager_auth', "{$managerData['uid']}\t{$auth_str}", 3600000);
                 FResponse::redirect('/');
                 return true;
             } else {
                 $newLoginLogData['result'] = 2;
                 $newLoginLogData['comment'] = '密码错误';
                 $managerLoginLogTable->insert($newLoginLogData);
                 return $this->error('对不起,密码错误!');
             }
         }
     }
     $this->display('admin/login');
 }
示例#11
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;
 }
示例#12
0
文件: Auction.php 项目: jiatower/php
 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');
 }
示例#13
0
文件: Menus.php 项目: jiatower/php
 public static function getLeftMenus($top)
 {
     global $_F;
     $manager_table = new FTable("manager");
     $manager = $manager_table->where(array('uid' => $_F["uid"]))->find();
     $top_menus_ids = explode(",", $manager['top_menus_id']);
     $left_menus_ids = explode(",", $manager['left_menus_id']);
     /*$left_menus=array();
             $left_menus['default'] =array(
                 array('name' => '创建幕幕帐号', 'url' => '/admin/YUser/add', 'url_jian' => '/admin/YUser/add'),
                 array('name' => '在线用户', 'url' => '/admin/Online/default', 'url_jian' => '/admin/Online/default')
             );
             foreach($top_menus_ids as &$top_menus_id) {
                 $left_menus_x=array();
                 $top_menus_table = new FTable("top_menus");
                 $top_menus1 = $top_menus_table->fields(array("name", "id","menu"))->where(array("id" => $top_menus_id))->find();
                 $left_menus_table = new FTable("left_menus");
                 $left_menus1 = $left_menus_table->fields(array("name", "url"))->where(array("top_menus_id" => $top_menus1['id'],"id"=>array('in' => $left_menus_ids)))->select();
                 // $left_menus_x[$top_menus1['menu']]=$left_menus1;
                 // array_push($left_menus[$top_menus1['menu']],$left_menus1);
     
                 foreach($left_menus1 as &$left_menus12){
                     $left=explode("/",$left_menus12["url"]);
                     $left_menus12["url_jian"] = "/".$left[1]."/".$left[2]."/";
                 }
                 $left_menus[$top_menus1['menu']]=$left_menus1;
             }
              echo(json_encode($left_menus));
             $menuArray =$left_menus;
     
     
     
     
             $menuItems = $menuArray[$top];*/
     $left_menus_table = new FTable("left_menus");
     $left_menus1 = $left_menus_table->fields(array("name", "url"))->where(array("menu" => $top, "id" => array('in' => $left_menus_ids)))->select();
     foreach ($left_menus1 as &$left_menus12) {
         $left = explode("/", $left_menus12["url"]);
         $left_menus12["url_jian"] = "/" . $left[1] . "/" . $left[2] . "/";
     }
     $menuItems = $left_menus1;
     return $menuItems;
 }
示例#14
0
 /**
  * 用户资料首审
  */
 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);
 }
示例#15
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;
 }
示例#16
0
文件: Client.php 项目: jiatower/php
 /**
  * 约会说明
  */
 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');
 }
示例#17
0
文件: App.php 项目: jiatower/php
 public function addUpdateAction()
 {
     if ($this->isPost()) {
         return;
     }
     $ver = CommonUtil::getComParam(FRequest::getInt("ver"), 0);
     if ($ver == 0) {
         $this->error("ver 版本错误");
         return;
     }
     $table = new FTable("app_version_config");
     $app_data = $table->where(array("ver" => $ver))->find();
     $summary_arr = explode("\n", $app_data["summary"]);
     $app_data["summary"] = $summary_arr;
     $table2 = new FTable("app_version");
     $update_data = $table2->where(array("ver" => $ver))->order(array("tm" => "desc"))->select();
     $this->assign("update_data", $update_data);
     $this->assign("app_version", $app_data);
     $spmList = Service_Edit::getAllSpm();
     $this->assign('spmarr', json_encode($spmList));
     $c_names = Service_Edit::getSpmMap($spmList);
     $this->assign('spmList', $c_names);
     $this->display("add_version");
 }
示例#18
0
文件: Share.php 项目: jiatower/php
 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');*/
 }
示例#19
0
 public function shenheAction()
 {
     // global $_F;
     // $_F["debug"] = true;
     $status = FRequest::getPostInt('status');
     $url = FRequest::getPostString('url');
     $data2 = array('sexy_review' => '0', 'ad_review' => '0', 'status' => $status);
     $image_md5_table = new FTable("image_md5");
     $result = $image_md5_table->where(array('url' => $url))->update($data2);
     if ($result) {
         echo '修改成功!';
     } else {
         echo "修改失败";
     }
     return;
 }
示例#20
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');
 }
示例#21
0
 public function deleteAction()
 {
     $useradds = new FTable('user_address');
     $addrid = FRequest::getInt('addrid');
     $useradds->where(array('addrid' => $addrid))->remove(true);
     FResponse::redirect('r');
 }
示例#22
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');
 }
示例#23
0
文件: User.php 项目: jiatower/php
 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');
 }
示例#24
0
文件: FDB.php 项目: jiatower/php
 /**
  * 删除数据
  *
  * @param      $table string 表名
  * @param      $condition string 条件
  * @param bool $is_real_delete true 真删除,false 假删除
  *
  * @throws Exception
  * @return bool
  */
 public static function remove($table, $condition, $is_real_delete = false)
 {
     if (!$condition) {
         throw new Exception("FDB remove need condition. Remove is a very dangerous operation.");
     }
     $table = new FTable($table);
     $table->where($condition)->remove($is_real_delete);
     return true;
 }
示例#25
0
 function listAction()
 {
     global $_F;
     // $_F["debug"] = true;
     //$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_jintian . " 00:00:00'   ";
     $query_str2 = " ac.tm >= '" . $datetime_jintian . " 00:00:00'   ";
     $user_star_date = array();
     $user_star_date['date'] = $datetime_jintian;
     $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);
     if ($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->limit(30)->order(array("date" => "desc"))->select();
     $this->assign('user_star_date', $user_star_date);
     $this->assign('user_star_date1', $user_star_date1);
     $this->display('admin/user_xingjidate_list');
 }
示例#26
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";
 }
示例#27
0
文件: Edit.php 项目: jiatower/php
 /**
  * 表数据入库
  * @param $tjdata
  */
 public static function insertTjData($tjdata)
 {
     if ($tjdata != null && count($tjdata) > 0) {
         $report_table = new FTable("stats");
         $old_data = $report_table->where(array("stats_date" => $tjdata[0]["stats_date"], "hours" => $tjdata[0]["hours"]))->remove(true);
         foreach ($tjdata as $tjItem) {
             $report_table->insert($tjItem);
         }
     }
 }
示例#28
0
文件: Images.php 项目: jiatower/php
 /**
  * 插入数据库
  */
 private static function addIntoDb($images)
 {
     $log = new FLogger("images_log");
     if ($images) {
         foreach ($images as $img) {
             $url = $img["url"];
             $image_table = new FTable("image_md5");
             $ok = $image_table->where(array("url" => $url))->save($img);
             if (!$ok) {
                 $log->append("[ERROR] addIntoDb is error, r : " . $ok . " ,url :" . $url . "--img: " . json_encode($img));
                 continue;
             }
         }
     }
 }
示例#29
0
 /**
  * 统计符合条目的数目
  *
  * @param $table
  * @param null $conditions
  *
  * @return int
  */
 public static function count($table, $conditions = null, $db_conf = '')
 {
     if ($db_conf) {
         $table = new FTable($table, '', $db_conf);
     } else {
         $table = new FTable($table);
     }
     return $table->where($conditions)->count();
 }
示例#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');
 }