Esempio n. 1
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $id = intval($GLOBALS['request']['id']);
         $bid_money = floatval($GLOBALS['request']["bid_money"]);
         $bid_paypassword = strim($GLOBALS['request']['bid_paypassword']);
         $status = dobid2($id, $bid_money, $bid_paypassword);
         if ($status['status'] != 1) {
             $root['response_code'] = 0;
             $root['show_err'] = $status['show_err'];
         } else {
             $root['response_code'] = 1;
             $root['show_err'] = $GLOBALS['lang']['DEAL_BID_SUCCESS'];
             $root['id'] = $id;
         }
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
 function dobid()
 {
     $ajax = intval($_REQUEST["ajax"]);
     $id = intval($_REQUEST["id"]);
     $bid_money = floatval($_REQUEST["bid_money"]);
     $bid_paypassword = strim(FW_DESPWD($_REQUEST['bid_paypassword']));
     $status = dobid2($id, $bid_money, $bid_paypassword, 1);
     if ($status['status'] == 0) {
         showErr($status['show_err'], $ajax);
     } elseif ($status['status'] == 2) {
         do_loans($id, date('Y-m-d'));
         // 满标自动放款
         ajax_return($status);
     } elseif ($status['status'] == 3) {
         showSuccess("余额不足,请先去充值", $ajax, url("index", "uc_money#incharge"));
     } else {
         //showSuccess($GLOBALS['lang']['DEAL_BID_SUCCESS'],$ajax,url("index","deal",array("id"=>$id)));
         showSuccess($GLOBALS['lang']['DEAL_BID_SUCCESS'], $ajax, url("index", "uc_invest"));
     }
 }