public function index()
 {
     $id = intval($GLOBALS['request']['id']);
     $email = strim($GLOBALS['request']['email']);
     $pwd = strim($GLOBALS['request']['pwd']);
     if (!dealIdIsExist($id, 1)) {
         $result = responseErrorInfo("deal_id参数错误");
         output($result);
     }
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     get_mortgate();
     // 不知道为什么要冻结
     $deal_info = $this->getDealInfo($id, $user_id);
     $leader_info = getLeaderInfo($id);
     $deal_new_info = $this->getNewDeal_info($deal_info);
     // $stock_info = $this->getStockAndUnStock ( $deal_info );
     // $history_info = $this->getHistoryInfo ( $deal_info );
     // $plan_info = $this->getPlanInfo ( $deal_info );
     $result = responseSuccessInfo("项目详情");
     $result["deal_info"] = $deal_new_info;
     $result['leader_info'] = $leader_info;
     // $result ['stock_info'] = $stock_info;
     // $result ['history_info'] = $history_info;
     // $result ['plan_info'] = $plan_info;
     if ($user_id > 0) {
         $is_focus = $GLOBALS['db']->getOne("select  count(*) from " . DB_PREFIX . "deal_focus_log where deal_id = " . $id . " and user_id = " . $user_id);
         $result['is_focus'] = $is_focus;
     }
     $result['business_url'] = get_domain() . url_mapi_html("deal#business", array("id" => $id, "user_id" => $user_id));
     $result['teams_url'] = get_domain() . url_mapi_html("deal#teams", array("id" => $id, "user_id" => $user_id));
     $result['history_url'] = get_domain() . url_mapi_html("deal#history", array("id" => $id, "user_id" => $user_id));
     $result['plans_url'] = get_domain() . url_mapi_html("deal#plans", array("id" => $id, "user_id" => $user_id));
     $url = replace_mapi(url_wap("deal#show", array("id" => $id)));
     $result['share_url'] = $url;
     if ($GLOBALS['m_config']['wx_appid'] != '' && $GLOBALS['m_config']['wx_secrit'] != '') {
         $weixin_1 = new weixin($GLOBALS['m_config']['wx_appid'], $GLOBALS['m_config']['wx_secrit'], $url);
         $wx_url = $weixin_1->scope_get_code();
         $result['wx_share_url'] = $wx_url;
     }
     output($result);
 }
Beispiel #2
0
    if ($wx_info['openid']) {
        $wx_user_info = get_user_has('wx_openid', $wx_info['openid']);
        if ($wx_user_info) {
            //如果会员存在,直接登录
            do_login_user($wx_user_info['mobile'], $wx_user_info['user_pwd']);
        } else {
            //会员不存在进入登录流程
            $class = 'user_wx_register';
            //app_redirect(wap_url('index','user_wx_register'));
        }
    }
} else {
    if ($is_weixin && !$user_info && $m_config['wx_app_key'] && $m_config['wx_app_secret'] && $class != 'user_wx_register' && $class != 'register_verify_phone' && $class != 'wx_do_register') {
        //echo $class;exit;
        $weixin_2 = new weixin($m_config['wx_app_key'], $m_config['wx_app_secret'], get_domain() . $_SERVER["REQUEST_URI"]);
        $wx_url = $weixin_2->scope_get_code();
        app_redirect($wx_url);
    }
}
//获取模板文件的名称
$tmpl_dir = $class . '_' . $act2 . '.html';
//=========================
//$request_url = 'http://127.0.0.1/'.str_replace('/wap', '', APP_ROOT).'/sjmapi/index.php';
$request_url = get_domain() . str_replace('/wap', '', APP_ROOT) . '/sjmapi/index.php';
//echo $request_url;exit;
//echo get_domain()."<br>;".APP_ROOT; exit;
$city_id = intval($request_param['city_id']);
//用户从前台直接选择某个城市
$city_name = strim($request_param['city_name']);
if ($city_id == 0 && es_session::get("city_id")) {
    $city_id = es_session::get("city_id");
Beispiel #3
0
 public function mobile()
 {
     $config = M("MConfig")->order("sort asc")->findAll();
     $wx_appid = '';
     $wx_secrit = '';
     $wx_url = '';
     foreach ($config as $k => $v) {
         if ($v['code'] == 'wx_appid') {
             $wx_appid = $v['val'];
             continue;
         }
         if ($v['code'] == 'wx_secrit') {
             $wx_secrit = $v['val'];
             continue;
         }
         if ($v['type'] == 4) {
             $config[$k]['value_scope'] = explode(',', $v['value_scope']);
         } else {
             $config[$k]['value_scope'] = '';
         }
     }
     if (!empty($wx_appid) && !empty($wx_secrit)) {
         require APP_ROOT_PATH . "system/utils/weixin.php";
         $weixin = new weixin($wx_appid, $wx_secrit, get_domain() . APP_ROOT . "/wap");
         $wx_url = $weixin->scope_get_code();
     }
     $this->assign('wx_url', $wx_url);
     $this->assign("config", $config);
     $this->display();
 }
Beispiel #4
0
function auto_login()
{
    /* if(!isWeixin()){
           header("Content-Type: text/html; charset=utf-8");
           echo "抱歉,该网站只能在微信端打开,请用微信打开该网页!";
           exit;
       } */
    $user_info = session('user_info');
    if ($_REQUEST['code'] && $_REQUEST['state'] == 1 && !$user_info) {
        require 'weixin.php';
        $weixin = new weixin('wxa7e0d8fb62b7d5df', 'cab576f236da15a72eed02bc0fb7820a', 'http://www.1qjx.com/');
        $wx_info = $weixin->scope_get_userinfo($_REQUEST['code']);
        if ($wx_info['openid']) {
            $wx_user_info = get_user_has('wx_openid', $wx_info['openid']);
            if ($wx_user_info) {
                //如果会员存在,直接登录
                do_login_user($wx_user_info['id'], $wx_user_info['name']);
            } else {
                //会员不存在,保存会员呢账号
                do_save_user($wx_info['nickname'], $wx_info['headimgurl'], $wx_info['openid']);
            }
        }
    } else {
        if (!$user_info) {
            require 'weixin.php';
            $weixin_2 = new weixin('wxa7e0d8fb62b7d5df', 'cab576f236da15a72eed02bc0fb7820a', 'http://www.1qjx.com/');
            $wx_url = $weixin_2->scope_get_code();
            redirect($wx_url);
        }
    }
}
Beispiel #5
0
         }
         //echo $wx_url;exit;
         app_redirect($wx_url);
     } else {
         if ($is_weixin && !$user_info && $wx_status && $class != 'ajax' && $class != 'user' && $m_config['wx_controll'] == 0) {
             $weixin_2 = new weixin($m_config['wx_appid'], $m_config['wx_secrit'], get_domain() . $current_url);
             if ($weixin_conf['platform_status']) {
                 $appid = $_REQUEST['appid'];
                 if (!$appid) {
                     $appid = $GLOBALS['db']->getOne("select authorizer_appid from " . DB_PREFIX . "weixin_account where type=1 and user_id=0 ");
                     if (!$appid) {
                         var_dump("管理员未绑定微信账号");
                         exit;
                     }
                 }
                 $wx_url = $weixin_2->scope_get_code($appid);
             } else {
                 $wx_url = $weixin_2->scope_get_code();
             }
             //echo $wx_url;exit;
             //file_put_contents('./t.txt',var_export($_REQUEST,TRUE)."==2\n",FILE_APPEND);
             app_redirect($wx_url);
         }
     }
 }
 if ($wx_status && $class != 'cart') {
     require_once APP_ROOT_PATH . "system/utils/jssdk.php";
     if ($weixin_conf['platform_status']) {
         $appid = $_REQUEST['appid'];
         if (!$appid) {
             $appid = $GLOBALS['db']->getOne("select authorizer_appid from " . DB_PREFIX . "weixin_account where type=1 and user_id=0 ");