inc_corp.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. CURSCRIPT != 'wap' && exit('FORBIDDEN');
  3. $catid = isset($catid) ? intval($catid) : '';
  4. $areaid = isset($areaid) ? intval($areaid) : '';
  5. $page = isset($page) ? $page : 1;
  6. $seo = get_seoset();
  7. $rewrite = $seo['seo_force_yp'];
  8. if ($Catid && $rewrite == 'rewrite') {
  9. $detail = explode('-', $Catid);
  10. if ($detail[0] && in_array($detail[0], array('catid', 'areaid', 'page'))) {
  11. $detail[1] = intval($detail[1]);
  12. for ($i = 0; $i < count($detail); $i++) {
  13. $_GET[$detail[$i]] = ${$detail[$i]} = str_replace(array('#@#', '#!#'), array('-', '/'), $detail[++$i]);
  14. }
  15. extract($_GET);
  16. }
  17. $Catid = $detail = NULL;
  18. }
  19. if ($catid) {
  20. if (!($corp = $db->getRow('SELECT * FROM `' . $db_mymps . 'corp` WHERE corpid = \'' . $catid . '\''))) {
  21. errormsg('该商家分类不存在!');
  22. }
  23. }
  24. $ypcategory = get_corp_tree(0, 'corp');
  25. $area_list = cat_list('area', 0, 0, false, 1);
  26. $where = ' WHERE a.status = \'1\' AND a.if_corp = \'1\' ';
  27. $where .= $catid ? ' AND b.catid IN(' . get_corp_children($catid) . ') ' : ' ';
  28. $where .= !$areaid ? '' : ' AND a.areaid = \'' . $areaid . '\' ';
  29. $perpage = $mayimobile['mobiletopicperpage'] ? $mayimobile['mobiletopicperpage'] : 10;
  30. $param = setparams(array('mod', 'catid', 'areaid'));
  31. $sql = 'SELECT a.* FROM `' . $db_mymps . 'member` AS a LEFT JOIN `' . $db_mymps . 'member_category` AS b ON a.userid = b.userid ' . $where . ' ORDER BY a.levelid DESC';
  32. $count_sql = 'SELECT COUNT(b.id) FROM `' . $db_mymps . 'member` AS a LEFT JOIN ' . $db_mymps . 'member_category AS b ON a.userid = b.userid ' . $where;
  33. $rows_num = $db->getOne($count_sql);
  34. $totalpage = ceil($rows_num / $perpage);
  35. $num = intval($page - 1) * $perpage;
  36. $page1 = page1($sql, $perpage);
  37. foreach ($page1 as $k => $val) {
  38. $arr['id'] = $val['id'];
  39. $arr['userid'] = $val['userid'];
  40. $arr['credits'] = $val['credits'];
  41. $arr['credit'] = $val['credit'];
  42. $arr['hit'] = $val['hit'];
  43. $arr['if_list'] = $val['if_list'];
  44. $arr['hourstime'] = str_replace(':0', ':00', $val['hourstime']);
  45. $arr['uri_m'] = mRewrite('store', array('uid' => $val['id']));
  46. $arr['prelogo'] = !strstr($val['prelogo'], 'http') ? $mymps_global['SiteUrl'] . $val['prelogo'] : $val['prelogo'];
  47. $arr['tname'] = $val['tname'] ? $val['tname'] : $val['userid'];
  48. $arr['tnamej'] = $charset == 'gbk' ? iconv('gb2312', 'utf-8', $arr['tname']) : $arr['tname'];
  49. $arr['address'] = $val['address'] ? $val['address'] : ($val['busway'] ? $val['busway'] : '暂无地址');
  50. $arr['addressj'] = $charset == 'gbk' ? iconv('gb2312', 'utf-8', $arr['address']) : $arr['address'];
  51. $arr['levelid'] = $val['levelid'];
  52. $arr['tel'] = $val['tel'] ? $val['tel'] : '暂无电话';
  53. $member[] = $arr;
  54. }
  55. if ($mayi) {
  56. $member = 5.4000000000000004 <= PHP_VERSION ? json_encode($member, JSON_UNESCAPED_SLASHES) : str_replace('\\/', '/', json_encode($member));
  57. echo $member;
  58. exit();
  59. }
  60. $loc = get_location_m('corp', $catid);
  61. $page_title = $loc['page_title'];
  62. include mymps_tpl('corp_list');
  63. ?>