コード例 #1
0
 /**
  * 获取城市联合对应城市主担店ID集
  * @param  string $city 城市名称
  * @return array
  */
 function getMainStoreId($city)
 {
     $baichengIds = $this->get100CityStoreIds();
     //查询自己所在城市主担店的专营店ID
     $this->CI->load->model('sellpointModel');
     $mainStoreList = $this->CI->sellpointModel->getList(array('County' => utf82gbk($city), 'SellPointID' => array('in', $baichengIds)));
     $mainStoreIds = array();
     foreach ($mainStoreList as $key => $value) {
         $mainStoreIds[] = (int) $value['SellPointID'];
     }
     return $mainStoreIds;
 }
コード例 #2
0
ファイル: functions.php プロジェクト: jianhuaixie/yundds
function utf82gbk(&$data)
{
    foreach ($data as $k => $v) {
        if (is_array($data[$k])) {
            utf82gbk($data[$k]);
        } else {
            $encode = mb_detect_encoding($v, array("ASCII", "UTF-8", "GB2312", "GBK", "BIG5"));
            if ($encode == 'UTF-8') {
                if (MB_CONV_ENCODE) {
                    $data[$k] = mb_convert_encoding($v, 'GBK', 'UTF-8');
                } else {
                    $data[$k] = iconv('UTF-8', 'GBK', $v);
                }
            }
        }
    }
}
コード例 #3
0
    if ($username) {
        $rs = $userDB->get_info($username, 'name');
        if ($rs && $rs[uid] != $lfjuid) {
            $username = "******";
        }
    }
    $rss = $db->get_one(" SELECT * FROM {$pre}special WHERE id='{$cid}' ");
    if (!$rss) {
        die("原数据不存在");
    }
    $username || ($username = $lfjid);
    /*如果系统做了限制,那么有的评论将不给提交成功,但没做提示评论失败*/
    if ($allow) {
        if (is_utf8($content) || is_utf8($username)) {
            $content = utf82gbk($content);
            $username = utf82gbk($username);
        }
        if (WEB_LANG == 'utf-8') {
            $content = gbk2utf8($content);
            $username = gbk2utf8($username);
        } elseif (WEB_LANG == 'big5') {
            require_once ROOT_PATH . "inc/class.chinese.php";
            $cnvert = new Chinese("GB2312", "BIG5", $content, ROOT_PATH . "./inc/gbkcode/");
            $content = $cnvert->ConvertIT();
            $cnvert = new Chinese("GB2312", "BIG5", $username, ROOT_PATH . "./inc/gbkcode/");
            $username = $cnvert->ConvertIT();
        }
        $db->query("INSERT INTO `{$pre}special_comment` (`cid` , `uid` , `username` , `posttime` , `content` , `ip` , `icon` , `yz` ) VALUES ('{$cid}', '{$lfjuid}', '{$username}', '{$timestamp}', '{$content}', '{$onlineip}', '{$icon}', '{$yz}')");
    }
} elseif ($action == "del") {
    $rs = $db->get_one("SELECT * FROM `{$pre}special_comment` WHERE id='{$id}'");
コード例 #4
0
 /**
  * 查询指定参数条件列表
  * @param string $area 地区
  * @param string $region 大区
  * @param string $spsarea 小区
  * @param string $province 省份
  * @param string $city 城市
  * @param number $storeId 专营店ID
  * @param string $keyword 关键字
  * @return array
  */
 function searchStore($area = '', $region = '', $spsarea = '', $province = '', $city = '', $storeId = 0, $keyword = '')
 {
     $where = array('SpState_sys' => 1, 'isOpen' => 1);
     //判断是否为正式环境
     if (defined('ENV') && ENV == 'production') {
         $where['SellPointID'] = array('notIn', array(694, 3767, 3868));
     }
     $area && ($where['Area_2015'] = utf82gbk($area));
     $region && ($where['Region_2015'] = utf82gbk($region));
     $spsarea && ($where['SpSArea_2015'] = utf82gbk($spsarea));
     $province && ($where['Province'] = utf82gbk($province));
     //城市筛选条件增加多项选择判断
     if ($city) {
         if (is_string($city)) {
             $where['County'] = utf82gbk($city);
         } elseif (is_array($city)) {
             $cityList = array();
             foreach ($city as $v) {
                 $cityList[] = utf82gbk($v);
             }
             $where['County'] = array('in', $cityList);
         }
     }
     if ($storeId) {
         if (is_int($storeId)) {
             $where['SellPointID'] = $storeId;
         }
         if (is_array($storeId)) {
             $where['SellPointID'] = array('in', (array) $storeId);
         }
     }
     $keyword && ($where['SellPointName'] = array('like', utf82gbk($keyword)));
     $findList = $this->getNewList($where);
     return $findList;
 }
コード例 #5
0
ファイル: index.php プロジェクト: jianhuaixie/yundds
            logutils::log_obj(json_decode($json,1));
            
            logutils::log_str('======json_decode a-2======');
            
            logutils::log_str('======json_decode2-1======');	
            logutils::log_obj(json_decode2($json));
            logutils::log_str('======json_decode2-2======');	
            */
            $request = json_decode($json, 1);
        }
    }
}
//exit;
//logutils::log_obj($_REQUEST);
if (EC_CHARSET == 'gbk') {
    utf82gbk($request);
}
//logutils::log_obj($request);
//filter_request($request);
//logutils::log_obj($request);
//logutils::log_str(print_r($request,true));
$class = strtolower(strim($request['act']));
define('ACT', $class);
//act常量
define('ACT_INDEX', intval($request['act_index']));
//回调下标
$username = strim($request['username']);
//用户名或邮箱
$password = strim($request['password']);
//密码
check_login($username, $password);
コード例 #6
0
 /**
  * 查询指定参数条件列表
  * @param string $area 地区
  * @param string $region 大区
  * @param string $spsarea 小区
  * @param string $province 省份
  * @param string $city 城市
  * @param number $storeId 专营店ID
  * @param string $keyword 关键字
  * @return array
  */
 function searchStore($area = '', $region = '', $spsarea = '', $province = '', $city = '', $storeId = 0, $keyword = '')
 {
     $where = array('SpState_sys' => 1, 'isOpen' => 1);
     $area && ($where['Area_2015'] = utf82gbk($area));
     $region && ($where['Region_2015'] = utf82gbk($region));
     $spsarea && ($where['SpSArea_2015'] = utf82gbk($spsarea));
     $province && ($where['Province'] = utf82gbk($province));
     $city && ($where['County'] = utf82gbk($city));
     if ($storeId) {
         if (is_int($storeId)) {
             $where['SellPointID'] = $storeId;
         }
         if (is_array($storeId)) {
             $where['SellPointID'] = array('in', (array) $storeId);
         }
     }
     $keyword && ($where['SellPointName'] = array('like', utf82gbk($keyword)));
     $findList = $this->getNewList($where);
     return $findList;
 }