function ci1($url){
$tempUrl = C('url').$url."&admin_id=".$_GET['admin_id']."&customer_id=".$_GET['customer_id'];
if (!isset($_GET['code'])){
$url = createOauthUrlForCode($tempUrl);
Header("Location: $url");
}else
{
$openid = getOpenId($_GET['code'],$tempUrl);
$dbbuyer = M('buyer');
$buyerwhre['buyer_WXID'] = $openid;
$buyer = $dbbuyer->where($buyerwhre)->find();
//print_r($openid);
if($buyer == NULL){
header('Location: http://mp.weixin.qq.com/s?__biz=MzA4NzA5OTk4MQ==&mid=201546728&idx=1&sn=e6306bf03ef64ce659601accf277247d#rd/');
}
return $buyer;
}
}public function allshop(){
$buyer =ci1('app.php?c=show&a=allshop'); 最佳答案