public function index()
 {
     $root = array();
     $root['return'] = 1;
     $cate_list = $GLOBALS['cache']->get("MOBILE_SEARCHCATE_CATELIST");
     if ($cate_list === false) {
         //取出标签分类
         $cate_list_data = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "topic_tag_cate where showin_mobile = 1 order by sort desc");
         $cate_list = array();
         foreach ($cate_list_data as $k => $v) {
             $cate_list[$k]['id'] = $v['id'];
             $cate_list[$k]['name'] = $v['name'];
             $cate_list[$k]['bg'] = get_abs_img_root($v['mobile_title_bg']);
             //查询分类下的标签
             $txt_tags_data = $GLOBALS['db']->getAll("select t.* from " . DB_PREFIX . "topic_tag as t left join " . DB_PREFIX . "topic_tag_cate_link as l on l.tag_id = t.id where l.cate_id =" . $v['id'] . " order by t.sort desc limit 12");
             $txt_tags = array();
             foreach ($txt_tags_data as $kk => $vv) {
                 $txt_tags[$kk]['tag_name'] = $vv['name'];
                 $txt_tags[$kk]['color'] = $vv['color'];
             }
             $cate_list[$k]['tags'] = $txt_tags;
         }
         $GLOBALS['cache']->set("MOBILE_SEARCHCATE_CATELIST", $cate_list, CACHE_TIME);
     }
     $root['item'] = $cate_list;
     output($root);
 }
 public function index()
 {
     require_once APP_ROOT_PATH . "system/libs/user.php";
     $root = array();
     $page = intval($GLOBALS['request']['page']);
     if ($page == 0) {
         $page = 1;
     }
     $uid = intval($GLOBALS['request']['uid']);
     $user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $uid . " and is_effect = 1 and is_delete = 0");
     if (!$user_info) {
         $root['info'] = "非法的会员";
         output($root);
     }
     $limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
     $image_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "topic_image where user_id = " . $user_info['id'] . " and topic_id > 0 order by create_time desc limit " . $limit);
     $image_total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic_image where user_id = " . $user_info['id'] . " and topic_id > 0  ");
     $images = array();
     foreach ($image_list as $k => $v) {
         $images[$k]['photo_id'] = $v['id'];
         $images[$k]['share_id'] = $v['topic_id'];
         $images[$k]['img'] = get_abs_img_root(get_spec_image($v['o_path'], 200, 0, 0));
         $images[$k]['height'] = floor($v['height'] * (200 / $v['width']));
     }
     $root['page'] = array("page" => $page, "page_total" => ceil($image_total / PAGE_SIZE));
     $root['item'] = $images;
     $root['return'] = 1;
     output($root);
 }
Example #3
0
 public function index()
 {
     $page = intval($GLOBALS['request']['page']);
     //分页
     $page = $page == 0 ? 1 : $page;
     $cate_id = intval($GLOBALS['request']['cate_id']);
     $city_id = intval($GLOBALS['request']['city_id']);
     $page_size = PAGE_SIZE;
     $limit = ($page - 1) * $page_size . "," . $page_size;
     /*输出分类*/
     $bigcate_list = $GLOBALS['db']->getAll("select id,name from " . DB_PREFIX . "topic_group_cate where is_effect=1 order by sort asc");
     if ($cate_id > 0) {
         $cate_condition = " and cate_id = " . $cate_id;
     }
     $sql = " select * from " . DB_PREFIX . "topic_group where is_effect = 1 {$cate_condition} order by sort desc limit " . $limit;
     $sql_count = "select count(*) from " . DB_PREFIX . "topic_group where is_effect = 1 {$cate_condition} ";
     $list = $GLOBALS['db']->getAll($sql);
     $count = $GLOBALS['db']->getOne($sql_count);
     foreach ($list as $k => $v) {
         $list[$k]['icon'] = get_abs_img_root(get_spec_image($v['icon'], 300, 181, 0));
     }
     $page_total = ceil($count / $page_size);
     $root = array();
     $root['bigcate_list'] = $bigcate_list;
     $root['return'] = 1;
     $root['email'] = $email;
     $root['f_link_data'] = get_link_list();
     $root['item'] = $list;
     $root['page'] = array("page" => $page, "page_total" => ceil($res['count'] / $page_size), "page_size" => $page_size);
     $root['page_title'] = "小组";
     output($root);
 }
Example #4
0
 public function index()
 {
     $root = array();
     $root['return'] = 1;
     //首页菜单列表
     $indexs_list = $GLOBALS['cache']->get("WAP_INDEXS_MORE_" . intval($GLOBALS['city_id']));
     if ($indexs_list === false) {
         $indexs = $GLOBALS['db']->getAll(" select * from " . DB_PREFIX . "m_index where status = 1 and mobile_type = 1 and city_id in (0," . intval($GLOBALS['city_id']) . ") order by sort desc ");
         $indexs_list = array();
         foreach ($indexs as $k => $v) {
             $indexs_list[$k]['id'] = $v['id'];
             $indexs_list[$k]['name'] = $v['name'];
             $indexs_list[$k]['icon_name'] = $v['vice_name'];
             //图标名 http://fontawesome.io/icon/bars/
             $indexs_list[$k]['color'] = $v['desc'];
             //颜色
             $indexs_list[$k]['img'] = get_abs_img_root($v['img']);
             /*
             $indexs_list[$k]['is_hot'] = $v['is_hot'];
             $indexs_list[$k]['is_new'] = $v['is_new'];				
             	
             $indexs_list[$k]['type'] = $v['type'];
             $indexs_list[$k]['data'] = $v['data'] = unserialize($v['data']);
             */
             $indexs_list[$k]['url'] = getWebAdsUrl($v['type'], unserialize($v['data']));
         }
         $GLOBALS['cache']->set("WAP_INDEXS_MORE_" . intval($GLOBALS['city_id']), $indexs_list, 300);
     }
     $root['indexs'] = $indexs_list;
     $root['page_title'] = "更多分类";
     output($root);
 }
 public function index()
 {
     require_once APP_ROOT_PATH . 'app/Lib/deal.php';
     /**
      * has_attr: 0:无属性; 1:有属性
      * 有商品属性在要购买时,要选择属性后,才能购买
      * change_cart_request_server: 
      * 编辑购买车商品时,需要提交到服务器端,让服务器端通过一些判断返回一些信息回来(如:满多少钱,可以免运费等一些提示)
      * 0:提交,1:不提交;
      * image_attr_a_id_{$attr_a_id} 图片列表,可以根据属性ID值,来切换图片列表;默认为:0
      * limit_num: 库存数量
      */
     $id = intval($GLOBALS['request']['id']);
     //商品ID
     $item = get_deal($id);
     $root = getGoodsArray($item);
     $root['return'] = 1;
     $root['attr'] = getAttrArray($id);
     $images = array();
     //image_attr_1_id_{$attr_1_id} 图片列表,可以根据属性ID值,来切换图片列表
     $sql = "select img from " . DB_PREFIX . "deal_gallery where deal_id = " . intval($id);
     $list = $GLOBALS['db']->getAll($sql);
     $gallery = array();
     $big_gallery = array();
     foreach ($list as $k => $image) {
         $gallery[] = get_abs_img_root(get_spec_image($image['img'], 320, 320, 0));
         $big_gallery[] = get_abs_img_root(get_spec_image($image['img'], 0, 0, 0));
     }
     $root['gallery'] = $gallery;
     $root['big_gallery'] = $big_gallery;
     output($root);
 }
Example #6
0
 public function index()
 {
     $page = intval($GLOBALS['request']['page']);
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     if ($page == 0) {
         $page = 1;
     }
     $page_size = PAGE_SIZE;
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $event_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_event order by sort desc limit " . $limit);
     $count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_event");
     foreach ($event_list as $k => $v) {
         $now = get_gmtime();
         $event_list[$k]['end_time'] = $v['event_end_time'];
         $event_list[$k]['url'] = url("shop", "deal_event#show", array("id" => $v['id']));
         $event_list[$k]['event_end_time'] = to_date($v['event_end_time'], 'Y-m-d');
         $event_list[$k]['icon'] = get_abs_img_root(make_img($v['icon'], 592, 215, 1));
         $event_list[$k]['sheng_time_format'] = to_date($v['event_end_time'] - $now, "d天h小时i分");
     }
     $page_total = ceil($count / $page_size);
     $root = array();
     $root['return'] = 1;
     $root['item'] = $event_list;
     $root['page'] = array("page" => $page, "page_total" => $page_total, "page_size" => $page_size);
     $root['page_title'] = "活动专题";
     $root['city_name'] = $city_name;
     output($root);
 }
Example #7
0
 public function index()
 {
     require_once APP_ROOT_PATH . "system/libs/user.php";
     $email = strim($GLOBALS['request']['email']);
     $pwd = strim($GLOBALS['request']['pwd']);
     $result = do_login_user($email, $pwd);
     $GLOBALS['user_info'] = $user_data = es_session::get('user_info');
     $page = intval($GLOBALS['request']['page']) > 0 ? intval($GLOBALS['request']['page']) : 1;
     $page_size = 20;
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $user_id = intval($GLOBALS['user_info']['id']);
     $sql = "select group_key,count(group_key) as total from " . DB_PREFIX . "msg_box  \r\n\t\t\t\twhere is_delete = 0 and ((to_user_id = " . $user_id . " and `type` = 0) or (from_user_id = " . $user_id . " and `type` = 1))  \r\n\t\t\t\tgroup by group_key \r\n\t\t\t\torder by system_msg_id desc,max(create_time) desc limit " . $limit;
     $sql_count = "select count(distinct(group_key)) from " . DB_PREFIX . "msg_box  \r\n\t\t\t\twhere is_delete = 0 and ((to_user_id = " . $user_id . " and `type` = 0) or (from_user_id = " . $user_id . " and `type` = 1))";
     $list = $GLOBALS['db']->getAll($sql);
     foreach ($list as $k => $v) {
         $list[$k] = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "msg_box where group_key = '" . $v['group_key'] . "' and ((to_user_id = " . $user_id . " and `type` = 0) or (from_user_id = " . $user_id . " and `type` = 1))  order by create_time desc limit 1");
         $list[$k]['total'] = $v['total'];
         if ($list[$k]['system_msg_id'] > 0) {
             $sys_msgs[] = array("mid" => $list[$k]['group_key'], "uid" => $list[$k]['to_user_id'], "status" => 1, "title" => $list[$k]['title'], "time" => pass_date($list[$k]['create_time']));
         } else {
             $msg_list[] = array("content" => $list[$k]['content'], "uid" => $list[$k]['from_user_id'], "user_name" => $list[$k]['from_user_id'] == $user_data['id'] ? "我" : $GLOBALS['db']->getOne("select user_name from " . DB_PREFIX . "user where id = " . intval($list[$k]['from_user_id'])), "user_avatar" => get_abs_img_root(get_muser_avatar($list[$k]['from_user_id'], "big")), "tuid" => $list[$k]['to_user_id'], "tuser_name" => $list[$k]['to_user_id'] == $user_data['id'] ? "我" : $GLOBALS['db']->getOne("select user_name from " . DB_PREFIX . "user where id = " . intval($list[$k]['to_user_id'])), "tuser_avatar" => get_abs_img_root(get_muser_avatar($list[$k]['to_user_id'], "big")), "time" => pass_date($list[$k]['create_time']), "msg_count" => $list[$k]['total'], "mlid" => $list[$k]['group_key']);
         }
     }
     $count = $GLOBALS['db']->getOne($sql_count);
     $root['return'] = 1;
     $root['sys_msgs'] = $sys_msgs;
     $root['msg_list'] = $msg_list;
     //分页
     $page_info['page'] = $page;
     $page_info['page_total'] = ceil($count / $page_size);
     $root['page'] = $page_info;
     output($root);
 }
Example #8
0
 public function index()
 {
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     $root = array();
     $user_data = $GLOBALS['user_info'];
     //logUtils::log_obj($user_data);
     $user_id = intval($user_data['id']);
     if ($user_id == 0) {
         $root['user_login_status'] = 0;
         $root['info'] = "请先登陆";
         $root['page_title'] = "登陆";
     } else {
         $root['user_login_status'] = 1;
         $root['info'] = "用户中心";
         $root['page_title'] = "用户中心";
         $root['uid'] = $user_data['id'];
         $root['user_name'] = $user_data['user_name'];
         $root['user_email'] = $user_data['email'];
         $root['user_money'] = $user_data['money'];
         $root['user_money_format'] = format_price($user_data['money']);
         //用户金额
         $root['user_avatar'] = get_abs_img_root(get_muser_avatar($user_data['id'], "big"));
     }
     $root['mana_page_title'] = '经理中心';
     $root['user'] = $user_data;
     $root['city_name'] = $city_name;
     output($root);
 }
Example #9
0
 public function index()
 {
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     $root = array();
     $root['page_title'] = '预约技师';
     //检查用户,用户密码
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     $root['return'] = 1;
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $sql = 'SELECT * FROM ' . DB_PREFIX . 'user WHERE is_effect = 1 AND is_delete = 0 AND service_type_id = 2';
         $tech_list = $GLOBALS['db']->getAll($sql);
         foreach ($tech_list as $key => $value) {
             $p = $GLOBALS['db']->getRow("select name from " . DB_PREFIX . "region_conf where id = " . $value['province_id']);
             $c = $GLOBALS['db']->getRow("select name from " . DB_PREFIX . "region_conf where id = " . $value['city_id']);
             for ($i = 0; $i < $value['service_level_id']; $i++) {
                 $value['tech_level'][] = $i;
             }
             $value['addr'] = $p['name'] . '-' . $c['name'] . '-' . $value['addr_detail'];
             $value['user_avatar'] = get_abs_img_root(get_muser_avatar($value['id'], "big"));
             $tech_list[$key] = $value;
         }
         $root['tech_list'] = $tech_list;
     } else {
         $root['user_login_status'] = 0;
     }
     $root['user'] = $user;
     $root['city_name'] = $city_name;
     output($root);
 }
Example #10
0
 public function index()
 {
     require_once APP_ROOT_PATH . "system/libs/user.php";
     $root = array();
     $user_data = $GLOBALS['user_info'];
     if (intval($user_data['id']) == 0) {
         $root['return'] = 0;
         $root['info'] = "请先登录";
         output($root);
     }
     if (isset($_FILES['image_1'])) {
         //开始上传
         //创建avatar临时目录
         if (!is_dir(APP_ROOT_PATH . "public/avatar")) {
             @mkdir(APP_ROOT_PATH . "public/avatar");
             @chmod(APP_ROOT_PATH . "public/avatar", 0777);
         }
         if (!is_dir(APP_ROOT_PATH . "public/avatar/temp")) {
             @mkdir(APP_ROOT_PATH . "public/avatar/temp");
             @chmod(APP_ROOT_PATH . "public/avatar/temp", 0777);
         }
         $img_result = save_image_upload($_FILES, "image_1", "avatar/temp", $whs = array('small' => array(48, 48, 1, 0), 'middle' => array(120, 120, 1, 0), 'big' => array(200, 200, 1, 0)));
         //开始移动图片到相应位置
         $id = intval($user_data['id']);
         $uid = sprintf("%09d", $id);
         $dir1 = substr($uid, 0, 3);
         $dir2 = substr($uid, 3, 2);
         $dir3 = substr($uid, 5, 2);
         $path = $dir1 . '/' . $dir2 . '/' . $dir3;
         //创建相应的目录
         if (!is_dir(APP_ROOT_PATH . "public/avatar/" . $dir1)) {
             @mkdir(APP_ROOT_PATH . "public/avatar/" . $dir1);
             @chmod(APP_ROOT_PATH . "public/avatar/" . $dir1, 0777);
         }
         if (!is_dir(APP_ROOT_PATH . "public/avatar/" . $dir1 . '/' . $dir2)) {
             @mkdir(APP_ROOT_PATH . "public/avatar/" . $dir1 . '/' . $dir2);
             @chmod(APP_ROOT_PATH . "public/avatar/" . $dir1 . '/' . $dir2, 0777);
         }
         if (!is_dir(APP_ROOT_PATH . "public/avatar/" . $dir1 . '/' . $dir2 . '/' . $dir3)) {
             @mkdir(APP_ROOT_PATH . "public/avatar/" . $dir1 . '/' . $dir2 . '/' . $dir3);
             @chmod(APP_ROOT_PATH . "public/avatar/" . $dir1 . '/' . $dir2 . '/' . $dir3, 0777);
         }
         $id = str_pad($id, 2, "0", STR_PAD_LEFT);
         $id = substr($id, -2);
         $avatar_file_big = APP_ROOT_PATH . "public/avatar/" . $path . "/" . $id . "virtual_avatar_big.jpg";
         $avatar_file_middle = APP_ROOT_PATH . "public/avatar/" . $path . "/" . $id . "virtual_avatar_middle.jpg";
         $avatar_file_small = APP_ROOT_PATH . "public/avatar/" . $path . "/" . $id . "virtual_avatar_small.jpg";
         @file_put_contents($avatar_file_big, file_get_contents($img_result['image_1']['thumb']['big']['path']));
         @file_put_contents($avatar_file_middle, file_get_contents($img_result['image_1']['thumb']['middle']['path']));
         @file_put_contents($avatar_file_small, file_get_contents($img_result['image_1']['thumb']['small']['path']));
         @unlink($img_result['image_1']['thumb']['big']['path']);
         @unlink($img_result['image_1']['thumb']['middle']['path']);
         @unlink($img_result['image_1']['thumb']['small']['path']);
         @unlink($img_result['image_1']['path']);
         //end 上传
     }
     $root['return'] = 1;
     $root['user_avatar'] = get_abs_img_root(get_muser_avatar($user_data['id'], "big"));
     output($root);
 }
 public function index()
 {
     require_once APP_ROOT_PATH . "system/libs/user.php";
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     $pwd = strim($GLOBALS['request']['pwd']);
     $result = do_login_user($email, $pwd);
     $GLOBALS['user_info'] = $user_data = es_session::get('user_info');
     $user_data['id'] = intval($user_data['id']);
     $page = intval($GLOBALS['request']['page']);
     if ($page == 0) {
         $page = 1;
     }
     $home_uid = intval($GLOBALS['request']['uid']);
     $home_user_info_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $home_uid . " and is_effect = 1 and is_delete = 0");
     if (!$home_user_info_data) {
         $root['info'] = "非法的会员";
         output($root);
     }
     $user_info['uid'] = $user_data['id'];
     $user_info['email'] = $user_data['email'];
     $user_info['user_name'] = $user_data['user_name'];
     $user_info['user_avatar'] = get_abs_img_root(get_muser_avatar($user_data['id'], "big"));
     $root['user'] = $user_info;
     $home_user_info['uid'] = $home_user_info_data['id'];
     $home_user_info['email'] = $home_user_info_data['email'];
     $home_user_info['user_name'] = $home_user_info_data['user_name'];
     $home_user_info['user_avatar'] = get_abs_img_root(get_muser_avatar($home_user_info_data['id'], "big"));
     $home_user_info['fans'] = $home_user_info_data['focused_count'];
     $home_user_info['follows'] = $home_user_info_data['focus_count'];
     $home_user_info['photos'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic_image where user_id = " . $home_user_info_data['id']);
     $home_user_info['favs'] = $GLOBALS['db']->getOne("select sum(fav_count) from " . DB_PREFIX . "topic where user_id = " . $home_user_info_data['id']);
     $root['home_user'] = $home_user_info;
     $limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
     $follow_list = $GLOBALS['db']->getAll("select focused_user_id as id,focused_user_name as user_name from " . DB_PREFIX . "user_focus where focus_user_id = " . $home_user_info_data['id'] . " order by id desc limit " . $limit);
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_focus where focus_user_id = " . $home_user_info_data['id']);
     $follows = array();
     foreach ($follow_list as $k => $v) {
         $follows[$k]['uid'] = $v['id'];
         $follows[$k]['user_name'] = $v['user_name'];
         $follows[$k]['fans'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_focus where focused_user_id = " . $v['id']);
         $follows[$k]['user_avatar'] = get_abs_img_root(get_muser_avatar($v['id'], "big"));
         if ($v['id'] == $user_data['id']) {
             $follows[$k]['is_follow'] = -1;
         } else {
             $focus_uid = intval($v['id']);
             $focus_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_focus where focus_user_id = " . $user_info['uid'] . " and focused_user_id = " . $focus_uid);
             if ($focus_data) {
                 $follows[$k]['is_follow'] = 1;
             } else {
                 $follows[$k]['is_follow'] = 0;
             }
         }
     }
     $root['page'] = array("page" => $page, "page_total" => ceil($total / PAGE_SIZE));
     $root['item'] = $follows;
     $root['return'] = 1;
     $root['status'] = 1;
     output($root);
 }
Example #12
0
 public function index()
 {
     require_once APP_ROOT_PATH . "system/libs/user.php";
     $user_data = $GLOBALS['user_info'];
     $page = intval($GLOBALS['request']['page']) > 0 ? intval($GLOBALS['request']['page']) : 1;
     $page_size = PAGE_SIZE;
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $user_id = intval($GLOBALS['user_info']['id']);
     $group_key = addslashes(trim($GLOBALS['request']['mid']));
     $sql = "select count(*) as count,max(system_msg_id) as system_msg_id,max(id) as id from " . DB_PREFIX . "msg_box  \n\t\t\t\twhere is_delete = 0 and ((to_user_id = " . $user_id . " and `type` = 0) or (from_user_id = " . $user_id . " and `type` = 1))  \n\t\t\t\tand group_key = '" . $group_key . "'";
     $row = $GLOBALS['db']->getRow($sql);
     if ($row['count'] == 0) {
         $root['return'] = 0;
     } elseif ($row['system_msg_id'] > 0) {
         //系统消息,仅查看
         $data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "msg_box where id = " . $row['id'] . " and is_delete = 0");
         $GLOBALS['db']->query("update " . DB_PREFIX . "msg_box set is_read = 1 where id = " . $row['id']);
         $root['return'] = 1;
         $root['msg'] = array('mid' => $group_key, 'title' => $data['title'], 'message' => $data['content'], 'time' => pass_date($data['create_time']));
     } else {
         $root['return'] = 1;
         $root['lid'] = $group_key;
         //消息记录
         $sql = "select * from " . DB_PREFIX . "msg_box  \n\t\t\t\t\twhere is_delete = 0 and ((to_user_id = " . $user_id . " and `type` = 0) or (from_user_id = " . $user_id . " and `type` = 1))  \n\t\t\t\t\tand group_key = '" . $group_key . "' \n\t\t\t\t\torder by create_time desc limit " . $limit;
         $sql_count = "select count(*) from " . DB_PREFIX . "msg_box  \n\t\t\t\t\twhere is_delete = 0 and ((to_user_id = " . $user_id . " and `type` = 0) or (from_user_id = " . $user_id . " and `type` = 1)) and group_key = '" . $group_key . "'";
         $upd_sql = "update " . DB_PREFIX . "msg_box set is_read = 1 \n\t\t\t\t\twhere is_delete = 0 and ((to_user_id = " . $user_id . " and `type` = 0) or (from_user_id = " . $user_id . " and `type` = 1))  \n\t\t\t\t\tand group_key = '" . $group_key . "' ";
         $GLOBALS['db']->query($upd_sql);
         $list = $GLOBALS['db']->getAll($sql);
         foreach ($list as $k => $v) {
             if ($v['to_user_id'] != $user_id) {
                 $dest_user_id = $v['to_user_id'];
                 break;
             }
             if ($v['from_user_id'] != $user_id) {
                 $dest_user_id = $v['from_user_id'];
                 break;
             }
         }
         $dest_user_name = $GLOBALS['db']->getOne("select user_name from " . DB_PREFIX . "user where id = " . $dest_user_id);
         $root['title'] = "与" . $dest_user_name . "的交流";
         $root['t_name'] = $dest_user_name;
         $count = $GLOBALS['db']->getOne($sql_count);
         $page_info['page'] = $page;
         $page_info['page_total'] = ceil($count / $page_size);
         $page_info['page_size'] = $page_size;
         $root['page'] = $page_info;
         $msg_list = array();
         foreach ($list as $k => $v) {
             $msg_list[] = array("miid" => $v['id'], "mlid" => $v['group_key'], "uid" => $v['from_user_id'], "message" => $v['content'], "time" => pass_date($v['create_time']), "tuid" => $v['to_user_id'], "tuser_name" => $v['to_user_id'] == $user_id ? "我" : $dest_user_name, "tuser_avatar" => get_abs_img_root(get_muser_avatar($v['to_user_id'], "big")), "content" => $v['content'], "user_name" => $v['from_user_id'] == $user_id ? "我" : $dest_user_name, "user_avatar" => get_abs_img_root(get_muser_avatar($v['from_user_id'], "big")));
         }
         $root['msg_list'] = $msg_list;
     }
     if (strim($GLOBALS['request']['from']) == "wap") {
         $root['f_link_data'] = get_link_list();
         $root['email'] = $email;
     }
     // fwb add 2014-08-27
     output($root);
 }
Example #13
0
 public function index()
 {
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     $root = array();
     $root['page_title'] = '名下技师';
     //检查用户,用户密码
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     $root['return'] = 1;
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         //配置分页参数
         require_once APP_ROOT_PATH . "wap/lib/page.php";
         $page_size = 10;
         $page = intval($GLOBALS['request']['page']);
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * $page_size . "," . $page_size;
         $sql = 'SELECT 
                     * 
                   FROM
                     ' . DB_PREFIX . 'user 
                   WHERE is_effect = 1 
                     AND is_delete = 0 
                     AND service_type_id = 2
                     AND p_id =' . $user_id . ' limit ' . $limit;
         $sql_count = 'SELECT 
                     count(*) 
                   FROM
                     ' . DB_PREFIX . 'user 
                   WHERE is_effect = 1 
                     AND is_delete = 0 
                     AND service_type_id = 2
                     AND p_id =' . $user_id;
         $tech_list = $GLOBALS['db']->getAll($sql);
         foreach ($tech_list as $key => $value) {
             $p = $GLOBALS['db']->getRow("select name from " . DB_PREFIX . "region_conf where id = " . $value['province_id']);
             $c = $GLOBALS['db']->getRow("select name from " . DB_PREFIX . "region_conf where id = " . $value['city_id']);
             for ($i = 0; $i < $value['service_level_id']; $i++) {
                 $value['tech_level'][] = $i;
             }
             $value['addr'] = $p['name'] . '-' . $c['name'] . '-' . $value['addr_detail'];
             $value['user_avatar'] = get_abs_img_root(get_muser_avatar($value['id'], "big"));
             $tech_list[$key] = $value;
         }
         //配置分页
         $count = $GLOBALS['db']->getOne($sql_count);
         $page_total = ceil($count / $page_size);
         $root['page'] = array("page" => $page, "page_total" => $page_total, "page_size" => $page_size);
         $root['tech_list'] = $tech_list;
     } else {
         $root['user_login_status'] = 0;
     }
     $root['user'] = $user;
     $root['city_name'] = $city_name;
     output($root);
 }
 public function index()
 {
     $root = array();
     $id = intval($GLOBALS['request']['id']);
     $sql = "select id, title, content from " . DB_PREFIX . "article where is_effect = 1 and is_delete = 0 and id =" . $id;
     //echo $sql; exit;
     $article = $GLOBALS['db']->getRow($sql);
     $root['id'] = $article['id'];
     $root['title'] = $article['title'];
     $root['content'] = get_abs_img_root($article['content']);
     $root['response_code'] = 1;
     output($root);
 }
Example #15
0
 public function index()
 {
     require_once APP_ROOT_PATH . "system/libs/user.php";
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     $pwd = strim($GLOBALS['request']['pwd']);
     $result = do_login_user($email, $pwd);
     $GLOBALS['user_info'] = $user_data = es_session::get('user_info');
     $user_data['id'] = intval($user_data['id']);
     $user_info['uid'] = $user_data['id'];
     $user_info['email'] = $user_data['email'];
     $user_info['user_name'] = $user_data['user_name'];
     $user_info['user_avatar'] = get_abs_img_root(get_muser_avatar($user_data['id'], "big"));
     $page = intval($GLOBALS['request']['page']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
     $list = $GLOBALS['db']->getAll("select id,user_name,daren_title from " . DB_PREFIX . "user where is_delete = 0 and is_effect = 1 and is_daren = 1 order by id desc limit " . $limit);
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user where is_delete = 0 and is_effect = 1 and is_daren = 1 ");
     $darens = array();
     foreach ($list as $k => $v) {
         $darens[$k]['uid'] = $v['id'];
         $darens[$k]['user_name'] = $v['user_name'];
         if ($v['daren_title'] != '') {
             $darens[$k]['user_name'] .= "[" . $v['daren_title'] . "]";
         }
         $darens[$k]['fans'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_focus where focused_user_id = " . $v['id']);
         $darens[$k]['user_avatar'] = get_abs_img_root(get_muser_avatar($v['id'], "big"));
         if ($v['id'] == $user_data['id']) {
             $darens[$k]['is_follow'] = -1;
         } else {
             $focus_uid = intval($v['id']);
             $focus_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_focus where focus_user_id = " . $user_info['uid'] . " and focused_user_id = " . $focus_uid);
             if ($focus_data) {
                 $darens[$k]['is_follow'] = 1;
             } else {
                 $darens[$k]['is_follow'] = 0;
             }
         }
     }
     $root['page'] = array("page" => $page, "page_total" => ceil($total / PAGE_SIZE));
     $root['item'] = $darens;
     $root['return'] = 1;
     $root['status'] = 1;
     output($root);
 }
Example #16
0
 public function index()
 {
     require_once APP_ROOT_PATH . "system/model/user.php";
     $email = strim($GLOBALS['request']['email']);
     $pwd = strim($GLOBALS['request']['pwd']);
     $root = array();
     $user_data = $GLOBALS['user_info'];
     $user_data['id'] = intval($user_data['id']);
     $uid = intval($user_data['id']);
     if ($uid == 0) {
         $root['info'] = "请先登陆";
         $root['return'] = 2;
         output($root);
     }
     $page = intval($GLOBALS['request']['page']);
     if ($page == 0) {
         $page = 1;
     }
     $user_info['uid'] = $user_data['id'];
     $user_info['email'] = $user_data['email'];
     $user_info['user_name'] = $user_data['user_name'];
     $user_info['user_avatar'] = get_abs_img_root(get_muser_avatar($user_data['id'], "big"));
     $root['home_user'] = $root['user'] = $user_info;
     //关注的用户ID
     $uids = $GLOBALS['db']->getOne("select group_concat(focused_user_id) from " . DB_PREFIX . "user_focus where focus_user_id = " . $user_data['id'] . " order by rand() limit 50");
     if ($uids) {
         $uids .= ",0";
     } else {
         $uids = "0";
     }
     $limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
     $topic_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0 and user_id in (" . $uids . ") order by create_time desc limit " . $limit);
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0 and user_id in (" . $uids . ") ");
     foreach ($topic_list as $k => $v) {
         $topic_list[$k] = m_get_topic_item($v);
         if ($v['fav_id'] > 0 || $v['relay_id'] > 0) {
             $relay_share = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0 and id = " . $v['origin_id']);
         }
         if ($relay_share) {
             $topic_list[$k]['relay_share'] = m_get_topic_item($relay_share);
         }
     }
     $root['return'] = 1;
     $root['item'] = $topic_list;
     $root['page'] = array("page" => $page, "page_total" => ceil($total / PAGE_SIZE), "page_size" => PAGE_SIZE);
     output($root);
 }
 public function index()
 {
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     $root = array();
     $root['page_title'] = '技师详情';
     $root['mana_page_title'] = '客户资料';
     //检查用户,用户密码
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     $root['return'] = 1;
     if ($user_id > 0) {
         $m_user_id = $GLOBALS['request']['m_user_id'];
         $root['user_login_status'] = 1;
         $sql = 'SELECT 
                     * 
                   FROM
                     ' . DB_PREFIX . 'user 
                   WHERE id =' . $m_user_id;
         $m_user = $GLOBALS['db']->getRow($sql);
         //地址
         $p = $GLOBALS['db']->getRow("select name from " . DB_PREFIX . "region_conf where id = " . $m_user['province_id']);
         $c = $GLOBALS['db']->getRow("select name from " . DB_PREFIX . "region_conf where id = " . $m_user['city_id']);
         $m_user['addr'] = $p['name'] . '-' . $c['name'] . '-' . $m_user['addr_detail'];
         //星级
         for ($i = 0; $i < $m_user['service_level_id']; $i++) {
             $m_user['tech_level'][] = $i;
         }
         //性别
         if ($m_user['sex'] == 1) {
             $m_user['sex'] = '男';
         } elseif ($m_user['sex'] == 0) {
             $m_user['sex'] = '女';
         } else {
             $m_user['sex'] = '保密';
         }
         //头像
         $m_user['user_avatar'] = get_abs_img_root(get_muser_avatar($m_user_id, "big"));
         $root['m_user'] = $m_user;
     } else {
         $root['user_login_status'] = 0;
     }
     $root['user'] = $user;
     $root['city_name'] = $city_name;
     output($root);
 }
 public function index()
 {
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     $root = array();
     $root['page_title'] = '投诉列表';
     $root['mana_page_title'] = '投诉列表';
     //检查用户,用户密码
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     //经理id
     $root['return'] = 1;
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         //配置分页参数
         require_once APP_ROOT_PATH . "wap/lib/page.php";
         $page_size = 10;
         $page = intval($GLOBALS['request']['page']);
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * $page_size . "," . $page_size;
         $sql = "SELECT\n                        doc.`id` AS complain_id,\n                        doi.`number`,\n                        doc.`create_time`,\n                        d.`id` AS deal_id,\n                        d.`current_price` AS price,\n                        d.`sub_name` AS service_name,\n                        d.`img` AS service_icon,\n                        do.`create_time` AS order_create_time \n                      FROM\n                        " . DB_PREFIX . "deal_order_complain doc \n                        LEFT JOIN " . DB_PREFIX . "deal_order DO \n                          ON doc.`order_id` = do.`id` \n                        LEFT JOIN " . DB_PREFIX . "deal_order_item doi \n                          ON do.`id` = doi.`order_id` \n                        LEFT JOIN " . DB_PREFIX . "deal d \n                          ON doi.`deal_id`=d.`id` \n                      WHERE do.`type` = 0 \n                        AND doc.`tech_id` IN \n                        (SELECT \n                          id \n                        FROM\n                          " . DB_PREFIX . "user fu \n                        WHERE fu.`p_id` = " . $user_id . " \n                          AND fu.`service_type_id` = 2 \n                          AND fu.`is_delete` = 0) GROUP BY doc.`id` ORDER BY doc.`create_time` DESC limit " . $limit;
         $sql_count = "SELECT \n                        count(*) \n                      FROM\n                        " . DB_PREFIX . "deal_order_complain doc \n                        LEFT JOIN " . DB_PREFIX . "deal_order DO \n                          ON doc.`order_id` = do.`id` \n                        LEFT JOIN " . DB_PREFIX . "deal_order_item doi \n                          ON do.`id` = doi.`order_id` \n                        LEFT JOIN " . DB_PREFIX . "deal d \n                          ON doi.`deal_id`=d.`id` \n                      WHERE do.`type` = 0 \n                        AND doc.`tech_id` IN \n                        (SELECT \n                          id \n                        FROM\n                          " . DB_PREFIX . "user fu \n                        WHERE fu.`p_id` = " . $user_id . " \n                          AND fu.`service_type_id` = 2 \n                          AND fu.`is_delete` = 0) GROUP BY doc.`id` ";
         $complain_list = $GLOBALS['db']->getAll($sql);
         foreach ($complain_list as $key => $value) {
             $value['total_price'] = format_price($value['price'] * $value['number']);
             $value['price'] = format_price($value['price']);
             $value['service_icon'] = get_abs_img_root(get_spec_image($value['service_icon'], 360, 288, 0));
             $value['order_create_time'] = date('Y-m-d H:i', $value['order_create_time']);
             $value['complain_time'] = date('Y-m-d H:i', $value['complain_time']);
             $complain_list[$key] = $value;
         }
         //配置分页
         $count = $GLOBALS['db']->getOne($sql_count);
         $page_total = ceil($count / $page_size);
         $root['page'] = array("page" => $page, "page_total" => $page_total, "page_size" => $page_size);
         $root['complain_list'] = $complain_list;
     } else {
         $root['user_login_status'] = 0;
     }
     $root['user'] = $user;
     $root['city_name'] = $city_name;
     output($root);
 }
 public function index()
 {
     require_once APP_ROOT_PATH . "system/libs/user.php";
     $email = strim($GLOBALS['request']['email']);
     $pwd = strim($GLOBALS['request']['pwd']);
     $result = do_login_user($email, $pwd);
     $user_data = es_session::get('user_info');
     $user_data['id'] = intval($user_data['id']);
     $uid = intval($user_data['id']);
     if ($uid == 0) {
         $root['return'] = 0;
         $root['info'] = "请先登陆";
         output($root);
     }
     $page = intval($GLOBALS['request']['page']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
     //输出回复
     $sql = "select r.* from " . DB_PREFIX . "topic_reply as r left join " . DB_PREFIX . "topic as t on r.topic_id = t.id \r\n\t\t\t\twhere (t.user_id = " . $uid . " or r.user_id = " . $uid . ") and r.is_effect = 1 and r.is_delete = 0 \r\n\t\t\t\torder by r.create_time desc limit " . $limit;
     $sql_count = "select count(*) from " . DB_PREFIX . "topic_reply as r left join " . DB_PREFIX . "topic as t on r.topic_id = t.id \r\n\t\t\t\twhere (t.user_id = " . $uid . " or r.user_id = " . $uid . ") and r.is_effect = 1 and r.is_delete = 0";
     $list = $GLOBALS['db']->getAll($sql);
     $total = $GLOBALS['db']->getOne($sql_count);
     $comment_list = array();
     foreach ($list as $k => $v) {
         $comment_list[$k]['comment_id'] = $v['id'];
         $comment_list[$k]['share_id'] = $v['topic_id'];
         $comment_list[$k]['uid'] = $v['user_id'];
         $comment_list[$k]['parent_id'] = $v['reply_id'];
         $comment_list[$k]['content'] = $v['content'];
         $comment_list[$k]['create_time'] = $v['create_time'];
         $topic = $GLOBALS['db']->getRow("select user_name,content from " . DB_PREFIX . "topic where id = " . $v['topic_id']);
         $comment_list[$k]['scontent'] = "//@" . $topic['user_name'] . ":" . $topic['content'];
         $comment_list[$k]['user_name'] = $v['user_name'];
         $comment_list[$k]['user_avatar'] = get_abs_img_root(get_muser_avatar($v['user_id'], "big"));
         $comment_list[$k]['time'] = pass_date($v['create_time']);
         $comment_list[$k]['parse_expres'] = get_parse_expres($comment_list[$k]['content'] . $comment_list[$k]['scontent']);
         $comment_list[$k]['parse_user'] = get_parse_user($comment_list[$k]['content'] . $comment_list[$k]['scontent']);
     }
     $root['item'] = $comment_list;
     $root['page'] = array("page" => $page, "page_total" => ceil($total / PAGE_SIZE));
     $root['return'] = 1;
     output($root);
 }
Example #20
0
 public function index()
 {
     /*
     	$email = strim($GLOBALS['request']['email']);//用户名或邮箱
     	if (isset($GLOBALS['request']['old_pwd'])){
     		$pwd = strim($GLOBALS['request']['old_pwd']);//密码
     	}else{
     		$pwd = strim($GLOBALS['request']['pwd']);//密码
     	}
     */
     $new_pwd = strim($GLOBALS['request']['newpassword']);
     //新密码
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     //检查用户,用户密码
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     $root = array();
     $root['page_title'] = '修改密码';
     $root['user_name'] = $user['user_name'];
     $root['city_name'] = $city_name;
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         if (strlen($GLOBALS['request']['newpassword']) < 4) {
             $root['return'] = 0;
             $root['info'] = "注册密码不能少于4位";
             output($root);
         }
         $new_pwd = md5($new_pwd);
         $sql = "update " . DB_PREFIX . "user set user_pwd = '" . $new_pwd . "' where id = {$user_id}";
         $GLOBALS['db']->query($sql);
         $root['return'] = 1;
         $root['uid'] = $user_id;
         $root['email'] = $user['email'];
         $root['user_name'] = $user['user_name'];
         $root['user_pwd'] = $new_pwd;
         $root['user_avatar'] = get_abs_img_root(get_muser_avatar($user['id'], "big"));
         $root['info'] = "密码更新成功!";
     } else {
         $root['return'] = 0;
         $root['user_login_status'] = 0;
         $root['info'] = "原始密码不正确";
     }
     output($root);
 }
Example #21
0
 public function index()
 {
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $new_pwd = strim($GLOBALS['request']['newpassword']);
     //新密码
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     $root = array();
     if ($user_id > 0) {
         $root['user_login_status'] = 0;
         if (strlen($GLOBALS['request']['newpassword']) < 4) {
             $root['return'] = 0;
             $root['info'] = "注册密码不能少于4位";
             output($root);
         }
         if ($new_pwd != $pwd) {
             $sql = "update " . DB_PREFIX . "user set user_pwd = '" . md5($new_pwd) . "' where id = {$user_id}";
             $GLOBALS['db']->query($sql);
             $rs = $GLOBALS['db']->affected_rows();
         } else {
             $rs = 1;
         }
         if ($rs > 0) {
             $root['return'] = 1;
             $root['uid'] = $user_id;
             $root['email'] = $user['email'];
             $root['user_name'] = $user['user_name'];
             $root['user_avatar'] = get_abs_img_root(get_muser_avatar($user['id'], "big"));
             $root['info'] = "密码更新成功!";
         } else {
             $root['return'] = 0;
             $root['info'] = "密码更新失败!";
         }
     } else {
         $root['return'] = 0;
         $root['user_login_status'] = 1;
         $root['info'] = "原始密码不正确";
     }
     output($root);
 }
Example #22
0
 public function index()
 {
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     $root = array();
     $root['page_title'] = '订单列表';
     $root['mana_page_title'] = '订单列表';
     //检查用户
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     $root['return'] = 1;
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         //配置分页参数
         require_once APP_ROOT_PATH . "wap/lib/page.php";
         $page_size = 10;
         $page = intval($GLOBALS['request']['page']);
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * $page_size . "," . $page_size;
         $sql = "SELECT \n                    d.`sub_name` AS deal_name,\n                    d.`current_price` AS deal_price,\n                    d.`id` AS deal_id,\n                    d.`icon`,\n                    o.`id` AS order_id,\n                    o.`total_price`,\n                    o.`create_time`,\n                    o.`is_get_bonus`,\n                    doi.`number` \n                  FROM\n                    " . DB_PREFIX . "deal_order o \n                    LEFT JOIN " . DB_PREFIX . "deal d \n                      ON o.`deal_ids` = d.`id` \n                    LEFT JOIN " . DB_PREFIX . "deal_order_item doi \n                      ON o.`id` = doi.`order_id` \n                  WHERE TYPE = 0 \n                    AND technician_id IN \n                    (SELECT \n                      id \n                    FROM\n                      " . DB_PREFIX . "user \n                    WHERE p_id = " . $user_id . " \n                      AND service_type_id = 2 \n                      AND is_delete = 0 \n                      AND is_effect = 1) ORDER BY o.`create_time` DESC limit " . $limit;
         $sql_count = "SELECT count(o.`id`) \n                  FROM\n                    " . DB_PREFIX . "deal_order o \n                    LEFT JOIN " . DB_PREFIX . "deal d \n                      ON o.`deal_ids` = d.`id` \n                    LEFT JOIN " . DB_PREFIX . "deal_order_item doi \n                      ON o.`id` = doi.`order_id` \n                  WHERE TYPE = 0 \n                    AND technician_id IN \n                    (SELECT \n                      id \n                    FROM\n                      " . DB_PREFIX . "user \n                    WHERE p_id = " . $user_id . " \n                      AND service_type_id = 2 \n                      AND is_delete = 0 \n                      AND is_effect = 1)";
         $order_list = $GLOBALS['db']->getAll($sql);
         foreach ($order_list as $key => $value) {
             $value['mana_fee'] = format_price($value['total_price'] * $user['manager_commission_fee_percent'] * 0.01);
             $value['deal_price'] = format_price($value['deal_price']);
             $value['total_price'] = format_price($value['total_price']);
             $value['create_time'] = date('Y-m-d H:i', $value['create_time']);
             $value['icon'] = get_abs_img_root(get_spec_image($value['icon'], 360, 288, 0));
             $order_list[$key] = $value;
         }
         //配置分页
         $count = $GLOBALS['db']->getOne($sql_count);
         $page_total = ceil($count / $page_size);
         $root['page'] = array("page" => $page, "page_total" => $page_total, "page_size" => $page_size);
         $root['order_list'] = $order_list;
     } else {
         $root['user_login_status'] = 0;
     }
     $root['user'] = $user;
     $root['city_name'] = $city_name;
     output($root);
 }
Example #23
0
 public function index()
 {
     $ytop = $latitude_top = floatval($GLOBALS['request']['latitude_top']);
     //最上边纬线值 ypoint
     $ybottom = $latitude_bottom = floatval($GLOBALS['request']['latitude_bottom']);
     //最下边纬线值 ypoint
     $xleft = $longitude_left = floatval($GLOBALS['request']['longitude_left']);
     //最左边经度值  xpoint
     $xright = $longitude_right = floatval($GLOBALS['request']['longitude_right']);
     //最右边经度值 xpoint
     $ypoint = $m_latitude = doubleval($GLOBALS['request']['m_latitude']);
     //ypoint
     $xpoint = $m_longitude = doubleval($GLOBALS['request']['m_longitude']);
     //xpoint
     $type = intval($GLOBALS['request']['type']);
     //-1:全部,0:优惠券;1:活动;2:团购;3:代金券;4:商家
     $bcate_id = strim($GLOBALS['request']['bcate_id']);
     /*大分类*/
     $cate_type_id = strim($GLOBALS['request']['cate_type_id']);
     /*小分类*/
     //print_r($GLOBALS['request']);
     $pi = 3.14159265;
     //圆周率
     $r = 6378137;
     //地球平均半径(米)
     $field_append = ", (ACOS(SIN(({$ypoint} * {$pi}) / 180 ) *SIN((ypoint * {$pi}) / 180 ) +COS(({$ypoint} * {$pi}) / 180 ) * COS((ypoint * {$pi}) / 180 ) *COS(({$xpoint} * {$pi}) / 180 - (xpoint * {$pi}) / 180 ) ) * {$r}) as distance ";
     $condition = "  ypoint > {$ybottom} and ypoint < {$ytop} and xpoint > {$xleft} and xpoint < {$xright} ";
     $limit = 10;
     /*查团购*/
     $res = m_get_deal_list($limit, $bcate_id, 0, array(DEAL_ONLINE), $condition, "distance asc", 0, $field_append, $cate_type_id);
     $tuan_list = array();
     foreach ($res['list'] as $item) {
         $item['icon'] = get_abs_img_root($item['icon']);
         $item['type'] = 2;
         $item['distance'] = round($item['distance']);
         $tuan_list[] = $item;
     }
     if ($tuan_list) {
         $root['item'] = $tuan_list;
     } else {
         $root['item'] = array();
     }
     output($root);
 }
Example #24
0
 public function index()
 {
     $root = array();
     $root['return'] = 1;
     $cate_list = $GLOBALS['cache']->get("MOBILE_SHARECATE_CATELIST");
     if ($cate_list === false) {
         //取出标签分类
         $cate_list_data = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "topic_tag_cate where showin_mobile = 1 order by sort desc");
         $cate_list = array();
         foreach ($cate_list_data as $k => $v) {
             $cate_list[$k]['cate_id'] = $v['id'];
             $cate_list[$k]['cate_name'] = $v['name'];
             $cate_list[$k]['desc'] = $v['sub_name'] == '' ? $v['name'] : $v['sub_name'];
             $cate_list[$k]['share_count'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic as t left join " . DB_PREFIX . "topic_cate_link as l on l.topic_id = t.id where l.cate_id =" . $v['id']);
             //查询分类下的分享
             $img_tags_data = $GLOBALS['db']->getAll("select t.* from " . DB_PREFIX . "topic as t left join " . DB_PREFIX . "topic_cate_link as l on l.topic_id = t.id where l.cate_id =" . $v['id'] . " and is_recommend = 1 and has_image = 1 order by t.create_time desc limit 5");
             $img_tags = array();
             foreach ($img_tags_data as $kk => $vv) {
                 $img_tags[$kk]['share_id'] = $vv['id'];
                 $topic_tags = explode(" ", $vv['tags']);
                 $img_tags[$kk]['tag_name'] = trim($topic_tags[0]);
                 $image = $GLOBALS['db']->getOne("select o_path from " . DB_PREFIX . "topic_image where topic_id = " . $vv['id'] . " limit 1");
                 if ($kk == 0) {
                     $img_tags[$kk]['img'] = get_abs_img_root(get_spec_image($image, 320, 320, 1));
                 } else {
                     $img_tags[$kk]['img'] = get_abs_img_root(get_spec_image($image, 160, 160, 1));
                 }
             }
             $cate_list[$k]['img_tags'] = $img_tags;
             //查询分类下的标签
             $txt_tags_data = $GLOBALS['db']->getAll("select t.* from " . DB_PREFIX . "topic_tag as t left join " . DB_PREFIX . "topic_tag_cate_link as l on l.tag_id = t.id where l.cate_id =" . $v['id'] . " order by t.sort desc limit 11");
             $txt_tags = array();
             foreach ($txt_tags_data as $kk => $vv) {
                 $txt_tags[$kk]['tag_name'] = $vv['name'];
                 $txt_tags[$kk]['color'] = $vv['color'];
             }
             $cate_list[$k]['txt_tags'] = $txt_tags;
         }
         $GLOBALS['cache']->set("MOBILE_SHARECATE_CATELIST", $cate_list, CACHE_TIME);
     }
     $root['item'] = $cate_list;
     output($root);
 }
Example #25
0
 public function index()
 {
     require_once APP_ROOT_PATH . "system/libs/user.php";
     $email = strim($GLOBALS['request']['email']);
     $pwd = strim($GLOBALS['request']['pwd']);
     $result = do_login_user($email, $pwd);
     $user_data = es_session::get('user_info');
     $uid = intval($user_data['id']);
     if ($uid == 0) {
         $root['info'] = "请先登陆";
         output($root);
     }
     $page = intval($GLOBALS['request']['page']);
     if ($page == 0) {
         $page = 1;
     }
     $user_info['uid'] = $user_data['id'];
     $user_info['email'] = $user_data['email'];
     $user_info['user_name'] = $user_data['user_name'];
     $user_info['user_avatar'] = get_abs_img_root(get_muser_avatar($user_data['id'], "big"));
     $root['home_user'] = $root['user'] = $user_info;
     $limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
     $user_name = $user_data['user_name'];
     $user_name_unicode = str_to_unicode_string($user_name);
     $condition = " match(user_name_match) against('" . $user_name_unicode . "' IN BOOLEAN MODE) ";
     $topic_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0 and " . $condition . " order by create_time desc limit " . $limit);
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0 and " . $condition);
     foreach ($topic_list as $k => $v) {
         $topic_list[$k] = m_get_topic_item($v);
         if ($v['fav_id'] > 0 || $v['relay_id'] > 0) {
             $relay_share = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0 and id = " . $v['origin_id']);
         }
         if ($relay_share) {
             $topic_list[$k]['relay_share'] = m_get_topic_item($relay_share);
         }
     }
     $root = array();
     $root['return'] = 1;
     $root['item'] = $topic_list;
     $root['page'] = array("page" => $page, "page_total" => ceil($total / PAGE_SIZE));
     output($root);
 }
Example #26
0
 public function index()
 {
     require_once APP_ROOT_PATH . "system/libs/user.php";
     $uid = intval($GLOBALS['request']['uid']);
     if ($uid == 0) {
         $email = strim($GLOBALS['request']['email']);
         $pwd = strim($GLOBALS['request']['pwd']);
         $result = do_login_user($email, $pwd);
         $user_data = es_session::get('user_info');
         $user_data['id'] = intval($user_data['id']);
         $uid = $user_data['id'];
     }
     $page = intval($GLOBALS['request']['page']);
     if ($page == 0) {
         $page = 1;
     }
     $page_size = 20;
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $root = array();
     $root['return'] = 1;
     $condition = " 1 = 1 ";
     $sort = "";
     $condition .= " and user_id = " . $uid . " and fav_id <> 0 ";
     $sort .= " order by  t.create_time desc  ";
     $sql = "select t.id,t.fav_id,t.origin_id from " . DB_PREFIX . "topic as t  where " . $condition . $sort . " limit " . $limit;
     $sql_total = "select count(*) from " . DB_PREFIX . "topic as t where " . $condition;
     $total = $GLOBALS['db']->getOne($sql_total);
     $result = $GLOBALS['db']->getAll($sql);
     $share_list = array();
     foreach ($result as $k => $v) {
         $share_list[$k]['share_id'] = $v['fav_id'];
         $image = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "topic_image where topic_id = " . $v['origin_id'] . " limit 1");
         $share_list[$k]['img'] = get_abs_img_root(get_spec_image($image['o_path'], 200, 0, 0));
         $share_list[$k]['height'] = floor($image['height'] * (200 / $image['width']));
     }
     $root['item'] = $share_list;
     //分页
     $page_info['page'] = $page;
     $page_info['page_total'] = ceil($total / $page_size);
     $root['page'] = $page_info;
     output($root);
 }
 public function index()
 {
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     $root = array();
     $root['page_title'] = '退款列表';
     //检查用户,用户密码
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     //经理id
     $root['return'] = 1;
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         //配置分页参数
         require_once APP_ROOT_PATH . "wap/lib/page.php";
         $page_size = 10;
         $page = intval($GLOBALS['request']['page']);
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * $page_size . "," . $page_size;
         $sql = "SELECT \n                        d.`sub_name` AS service_name,\n                        d.`icon` AS service_icon,\n                        d.`id` AS deal_id,\n                        do.`order_sn`,\n                        do.`create_time`,\n                        do.`refund_status`,\n                        do.`id` AS order_id \n                      FROM\n                        " . DB_PREFIX . "deal_order DO \n                        LEFT JOIN " . DB_PREFIX . "deal_order_item doi \n                          ON do.`id` = doi.`order_id` \n                        LEFT JOIN " . DB_PREFIX . "deal d \n                          ON doi.`deal_id` = d.`id` \n                      WHERE do.`pay_status` = 2 \n                        AND do.`user_id` = " . $user_id . " \n                      GROUP BY do.`id` \n                      ORDER BY do.`create_time` limit " . $limit;
         $sql_count = "SELECT \n                        count(*) \n                      FROM\n                        " . DB_PREFIX . "deal_order DO \n                        LEFT JOIN " . DB_PREFIX . "deal_order_item doi \n                          ON do.`id` = doi.`order_id` \n                        LEFT JOIN " . DB_PREFIX . "deal d \n                          ON doi.`deal_id` = d.`id` \n                      WHERE do.`pay_status` = 2 \n                        AND do.`user_id` = " . $user_id . " \n                      GROUP BY do.`id` ";
         $refund_list = $GLOBALS['db']->getAll($sql);
         foreach ($refund_list as $key => $value) {
             $value['service_icon'] = get_abs_img_root(get_spec_image($value['service_icon'], 360, 288, 0));
             $value['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
             $refund_list[$key] = $value;
         }
         //配置分页
         $count = $GLOBALS['db']->getOne($sql_count);
         $page_total = ceil($count / $page_size);
         $root['page'] = array("page" => $page, "page_total" => $page_total, "page_size" => $page_size);
         $root['refund_list'] = $refund_list;
     } else {
         $root['user_login_status'] = 0;
     }
     $root['user'] = $user;
     $root['city_name'] = $city_name;
     output($root);
 }
 public function index()
 {
     $root = array();
     $root['return'] = 1;
     $page = intval($GLOBALS['request']['page']);
     //分页
     $page = $page == 0 ? 1 : $page;
     $email = addslashes($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = addslashes($GLOBALS['request']['pwd']);
     //密码
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id == 0) {
         $root['user_login_status'] = 0;
         //用户登陆状态:1:成功登陆;0:未成功登陆
         output($root);
     } else {
         $root['user_login_status'] = 1;
     }
     $page_size = PAGE_SIZE;
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $sql_count = "select count(*) from " . DB_PREFIX . "brand";
     $sql = "select id,name,logo,dy_count from " . DB_PREFIX . "brand";
     $where = "1 = 1";
     $sql_count .= " where " . $where;
     $sql .= " where " . $where . " order by sort desc, dy_count ";
     $sql .= " limit " . $limit;
     $total = $GLOBALS['db']->getOne($sql_count);
     $page_total = ceil($total / $page_size);
     $list = $GLOBALS['db']->getAll($sql);
     $brand_list = array();
     foreach ($list as $item) {
         $brand_list[] = array("id" => $item['id'], "name" => $item['name'], "dy_count" => $item['dy_count'], "logo" => get_abs_img_root($item['logo']), "is_checked" => intval($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "brand_dy where uid = " . $user_id . " and brand_id = " . $item['id'])));
     }
     $root['item'] = $brand_list;
     $root['page'] = array("page" => $page, "page_total" => $page_total);
     output($root);
 }
Example #29
0
 public function index()
 {
     $root = array();
     $root['return'] = 1;
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $goods_id = intval($GLOBALS['request']['goods_id']);
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     $tuan_info = $GLOBALS['db']->getOne("select description from " . DB_PREFIX . "deal where id=" . $goods_id . "");
     //$tuan_info=str_replace("./public/","../public/",$tuan_info);
     $pattern = "/<[img|IMG].*?src=[\\'|\"](.*?(?:[\\.gif|\\.jpg|\\.png]))[\\'|\"].*?[\\/]?>/i";
     //$replacement = "<img width=300 $1 />";
     $replacement = "<img src='\$1' width='256' />";
     $tuan_info = get_abs_img_root(preg_replace($pattern, $replacement, $tuan_info));
     $root['tuan_info'] = $tuan_info;
     $root['email'] = $email;
     $root['city_name'] = $city_name;
     $root['page_title'] = "本单详情";
     output($root);
 }
Example #30
0
 public function index()
 {
     $id = intval($_REQUEST['id']);
     //分页
     $page_size = PAGE_SIZE;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $deal_info = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal where deal_event_id = " . $id . " order by sort desc limit " . $limit);
     $count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal where deal_event_id = " . $id);
     foreach ($deal_info as $k => $v) {
         $deal_info[$k]['url'] = url("shop", "goods", array("id" => $v['id']));
         $deal_info[$k]['current_price'] = round($v['current_price'], 2);
         $deal_info[$k]['origin_price'] = round($v['origin_price'], 2);
         $deal_info[$k]['img'] = get_abs_img_root($v['img']);
     }
     $root = array();
     $root['return'] = 1;
     $root['item'] = $deal_info;
     $root['page'] = array("page" => $page, "page_total" => ceil($count / $page_size), "page_size" => $page_size);
     output($root);
 }