예제 #1
0
 public function __construct()
 {
     $this->error = new ErrorCase();
     //-------读取配置文件
     $incFileContents = file_get_contents(ROOT . "comm/inc.php");
     $this->inc = json_decode($incFileContents);
     $config = System::load_app_config("connect", "qq");
     $this->inc->appid = $config['id'];
     $this->inc->appkey = $config['key'];
     $this->inc->callback = WEB_PATH . '/api/qqlogin/callback/';
     $this->inc->scope = "get_user_info";
     if (empty($this->inc)) {
         $this->error->showError("20001");
     }
     if (empty($_SESSION['QC_userData'])) {
         self::$data = array();
     } else {
         self::$data = $_SESSION['QC_userData'];
     }
 }
예제 #2
0
 public function commissions()
 {
     $num = 20;
     $total = $this->db->GetCount("SELECT COUNT(*) FROM `@#_member_cashout` WHERE 1");
     $page = System::load_sys_class('page');
     if (isset($_GET['p'])) {
         $pagenum = $_GET['p'];
     } else {
         $pagenum = 1;
     }
     $page->config($total, $num, $pagenum, "0");
     $commissions = $this->db->GetPage("SELECT * FROM `@#_member_cashout`  WHERE 1", array("num" => $num, "page" => $pagenum, "type" => 1, "cache" => 0));
     //查询用户名
     if (!empty($commissions)) {
         foreach ($commissions as $key => $val) {
             $uid = $val['uid'];
             $user[$key] = $this->db->GetOne("SELECT username FROM `@#_member` WHERE `uid`='{$uid}'  ");
         }
     }
     $fufen = System::load_app_config("user_fufen", '', 'member');
     include $this->tpl(ROUTE_M, 'member.commissions');
 }
예제 #3
0
 public function jf_paysubmit()
 {
     if (!isset($_POST['submit'])) {
         _message("正在返回购物车...", WEB_PATH . '/member/cart/jf_cartlist');
         exit;
     }
     session_start();
     if (isset($_POST['submitcode'])) {
         if (isset($_SESSION['submitcode'])) {
             $submitcode = $_SESSION['submitcode'];
         } else {
             $submitcode = null;
         }
         if ($_POST['submitcode'] == $submitcode) {
             unset($_SESSION["submitcode"]);
         } else {
             _message("请不要重复提交...", WEB_PATH . '/member/cart/jf_cartlist');
         }
     } else {
         _message("正在返回购物车...", WEB_PATH . '/member/cart/jf_cartlist');
     }
     parent::__construct();
     if (!$this->userinfo) {
         $this->HeaderLogin();
     }
     $uid = $this->userinfo['uid'];
     $pay_checkbox = !empty($_POST['moneycheckbox']) ? intval($_POST['moneycheckbox']) : 0;
     $shop_score = !empty($_POST['shop_score']) ? intval($_POST['shop_score']) : 0;
     $jf_use_num = !empty($_POST['jf_use_num']) ? intval($_POST['jf_use_num']) : 0;
     $pay_type_bank = isset($_POST['pay_bank']) ? $_POST['pay_bank'] : false;
     $pay_type_id = isset($_POST['account']) ? $_POST['account'] : false;
     if (!$pay_checkbox && !$shop_score) {
         _message("请选择支付方式", WEB_PATH . '/member/cart/jf_cartlist');
     }
     $fufen = System::load_app_config("user_fufen");
     $fufen['fufen_yuan'] = $fufen['fufen_yuan'] > 0 ? $fufen['fufen_yuan'] : 1;
     if ($shop_score && ($jf_use_num <= 0 || $jf_use_num % $fufen['fufen_yuan'] != 0)) {
         _message("请正确输入夺宝币数量", WEB_PATH . '/member/cart/jf_cartlist');
     }
     if ($pay_checkbox) {
         $payact = 'zh';
     }
     if ($shop_score) {
         $payact = 'jf';
     }
     if ($shop_score && $pay_checkbox) {
         $payact = 'all';
     }
     /*************
     			start
     		*************/
     $Cartlist = json_decode(stripslashes($this->Cartlist_jf), true);
     $pay = System::load_app_class('pay', 'pay');
     $pay->fufen = $shop_score ? $jf_use_num : 0;
     $pay->pay_type_bank = 0;
     $ok = $pay->init($uid, $payact, 'jf_go_record');
     //购买商品
     if ($ok !== 'ok') {
         $_COOKIE['Cartlist_jf'] = NULL;
         _setcookie("Cartlist_jf", null);
         _message($ok, G_WEB_PATH);
     }
     $check = $pay->jf_go_pay($pay_checkbox);
     if ($check + 100 == 0) {
         _message("账户余额不足以支付,请<a href='" . WEB_PATH . "/member/home/userrecharge' style='color:#22AAFF'>充值</a>");
     }
     if ($check === 'not_pay') {
         _message('未选择支付平台!', WEB_PATH . '/member/cart/jf_cartlist');
     }
     if (!$check) {
         _message("商品支付失败!", WEB_PATH . '/member/cart/jf_cartlist');
     }
     if ($check) {
         //成功
         header("location: " . WEB_PATH . "/member/cart/jf_paysuccess");
     } else {
         //失败
         $_COOKIE['Cartlist_jf'] = NULL;
         _setcookie("Cartlist_jf", null);
         header("location: " . WEB_PATH);
     }
     exit;
 }
예제 #4
0
 public function mobilecheck()
 {
     $title = "手机认证 - " . _cfg("web_name");
     $check_code = _encrypt($this->segment(4), "DECODE");
     $check_code = @unserialize($check_code);
     if (!$check_code || !isset($check_code['name']) || !isset($check_code['time'])) {
         _message("参数不正确或者验证已过期!", WEB_PATH . '/register');
     }
     $name = $check_code['name'];
     $member = $this->db->GetOne("SELECT * FROM `@#_member` WHERE `reg_key` = '{$check_code['name']}' and `time` = '{$check_code['time']}' LIMIT 1");
     if (!$member) {
         _message("未知的来源!", WEB_PATH . '/register');
     }
     if ($member['mobilecode'] == '1') {
         _message("该账号验证成功", WEB_PATH . "/login");
     }
     if ($member['mobilecode'] == '-1') {
         $sendok = send_mobile_reg_code($member['reg_key'], $member['uid']);
         if ($sendok[0] != 1) {
             _message($sendok[1]);
         }
         header("location:" . WEB_PATH . "/member/user/mobilecheck/" . $this->segment(4));
         exit;
     }
     if (isset($_POST['submit'])) {
         $checkcodes = isset($_POST['checkcode']) ? $_POST['checkcode'] : _message("参数不正确!");
         if (strlen($checkcodes) != 6) {
             _message("验证码输入不正确!");
         }
         $usercode = explode("|", $member['mobilecode']);
         if ($checkcodes != $usercode[0]) {
             _message("验证码输入不正确!");
         }
         $fili_cfg = System::load_app_config("user_fufen");
         if ($member['yaoqing']) {
             $time = time();
             $yaoqinguid = $member['yaoqing'];
             //福分、经验添加
             if ($fili_cfg['f_visituser']) {
                 $this->db->Query("insert into `@#_member_account` (`uid`,`type`,`pay`,`content`,`money`,`time`) values ('{$yaoqinguid}','1','福分','邀请好友奖励','{$fili_cfg['f_visituser']}','{$time}')");
             }
             $this->db->Query("UPDATE `@#_member` SET `score`=`score`+'{$fili_cfg['f_visituser']}',`jingyan`=`jingyan`+'{$fili_cfg['z_visituser']}' where uid='{$yaoqinguid}'");
         }
         $check = $this->db->Query("UPDATE `@#_member` SET mobilecode='1',mobile='{$member['reg_key']}' where `uid`='{$member['uid']}'");
         _message("验证成功", WEB_PATH . "/login");
     }
     $enname = substr($name, 0, 3) . '****' . substr($name, 7, 10);
     $time = 120;
     $namestr = $this->segment(4);
     include templates("user", "mobilecheck");
 }
예제 #5
0
 function record()
 {
     $webname = $this->_cfg['web_name'];
     $member = $this->userinfo;
     $title = "我的会员中心";
     $memberdj = $this->db->GetList("select * from `@#_member_group`");
     $jingyan = $member['jingyan'];
     if (!empty($memberdj)) {
         foreach ($memberdj as $key => $val) {
             if ($jingyan >= $val['jingyan_start'] && $jingyan <= $val['jingyan_end']) {
                 $member['yungoudj'] = $val['name'];
             }
         }
     }
     $mysql_model = System::load_sys_class('model');
     $member = $this->userinfo;
     $uid = $member['uid'];
     $recount = 0;
     $fufen = System::load_app_config("user_fufen", '', 'member');
     //查询提现记录
     //$recordarr=$mysql_model->GetList("select * from `@#_member_recodes` a left join `@#_member_cashout` b on a.cashoutid=b.id where a.`uid`='$uid' and a.`type`='-3' ORDER BY a.`time` DESC");		$recordarr=
     $recordarr = $mysql_model->GetList("select * from  `@#_member_cashout`  where `uid`='{$uid}' ORDER BY `time` DESC limit 0,30");
     if (!empty($recordarr)) {
         $recount = 1;
     }
     include templates("mobile/invite", "record");
 }
예제 #6
0
 public function paysubmit()
 {
     if (!isset($_POST['submit'])) {
         _message("正在返回购物车...", WEB_PATH . '/member/cart/cartlist');
         exit;
     }
     session_start();
     if (isset($_POST['submitcode'])) {
         if (isset($_SESSION['submitcode'])) {
             $submitcode = $_SESSION['submitcode'];
         } else {
             $submitcode = null;
         }
         if ($_POST['submitcode'] == $submitcode) {
             unset($_SESSION["submitcode"]);
         } else {
             _message("请不要重复提交...", WEB_PATH . '/member/cart/cartlist');
         }
     } else {
         _message("正在返回购物车...", WEB_PATH . '/member/cart/cartlist');
     }
     parent::__construct();
     if (!$this->userinfo) {
         $this->HeaderLogin();
     }
     $uid = $this->userinfo['uid'];
     $pay_checkbox = isset($_POST['moneycheckbox']) ? true : false;
     $pay_type_bank = isset($_POST['pay_bank']) ? $_POST['pay_bank'] : false;
     $pay_type_id = isset($_POST['account']) ? $_POST['account'] : false;
     if (isset($_POST['shop_score'])) {
         $fufen_cfg = System::load_app_config("user_fufen", '', 'member');
         $fufen = intval($_POST['shop_score_num']);
         if ($fufen_cfg['fufen_yuan']) {
             $fufen = intval($fufen / $fufen_cfg['fufen_yuan']);
             $fufen = $fufen * $fufen_cfg['fufen_yuan'];
         }
     } else {
         $fufen = 0;
     }
     /*************
     			start
     		*************/
     $Cartlist = json_decode(stripslashes($this->Cartlist), true);
     $pay = System::load_app_class('pay', 'pay');
     //$pay->scookie = json_decode(base64_decode($_POST['cookies']));
     $pay->fufen = $fufen;
     $pay->pay_type_bank = $pay_type_bank;
     $ok = $pay->init($uid, $pay_type_id, 'go_record');
     //云购商品
     if ($ok !== 'ok') {
         $_COOKIE['Cartlist'] = NULL;
         _setcookie("Cartlist", null);
         _message($ok, G_WEB_PATH);
     }
     $check = $pay->go_pay($pay_checkbox);
     if ($check === 'not_pay') {
         _message('未选择支付平台!', WEB_PATH . '/member/cart/cartlist');
     }
     if (!$check) {
         _message("商品支付失败!", WEB_PATH . '/member/cart/cartlist');
     }
     if ($check) {
         //成功
         header("location: " . WEB_PATH . "/member/cart/paysuccess");
     } else {
         //失败
         $_COOKIE['Cartlist'] = NULL;
         _setcookie("Cartlist", null);
         header("location: " . WEB_PATH);
     }
     exit;
 }
예제 #7
0
 public function mobilecheck()
 {
     $member = $this->userinfo;
     if (isset($_POST['submit'])) {
         $shoujimahao = base64_decode(_getcookie("mobilecheck"));
         if (!_checkmobile($shoujimahao)) {
             _messagemobile("手机号码错误!");
         }
         $checkcodes = isset($_POST['mobile']) ? $_POST['mobile'] : _messagemobile("参数不正确!");
         if (strlen($checkcodes) != 6) {
             _messagemobile("验证码输入不正确!");
         }
         $usercode = explode("|", $member['mobilecode']);
         if ($checkcodes != $usercode[0]) {
             _messagemobile("验证码输入不正确!");
         }
         $this->db->Query("UPDATE `@#_member` SET `mobilecode`='1',`mobile` = '{$shoujimahao}' where `uid`='{$member['uid']}'");
         //夺宝币、经验添加
         $isset_user = $this->db->GetList("select `uid` from `@#_member_account` where `content`='手机认证完善奖励' and `type`='1' and `uid`='{$member['uid']}' and (`pay`='经验' or `pay`='夺宝币')");
         if (empty($isset_user)) {
             $config = System::load_app_config("user_fufen");
             //夺宝币/经验
             $time = time();
             $this->db->Query("insert into `@#_member_account` (`uid`,`type`,`pay`,`content`,`money`,`time`) values ('{$member['uid']}','1','夺宝币','手机认证完善奖励','{$config['f_phonecode']}','{$time}')");
             $this->db->Query("insert into `@#_member_account` (`uid`,`type`,`pay`,`content`,`money`,`time`) values ('{$member['uid']}','1','经验','手机认证完善奖励','{$config['z_phonecode']}','{$time}')");
             $this->db->Query("UPDATE `@#_member` SET `score`=`score`+'{$config['f_phonecode']}',`jingyan`=`jingyan`+'{$config['z_phonecode']}' where uid='" . $member['uid'] . "'");
         }
         _setcookie("uid", _encrypt($member['uid']));
         _setcookie("ushell", _encrypt(md5($member['uid'] . $member['password'] . $member['mobile'] . $member['email'])));
         //夺宝币、经验添加
         $isset_user = $this->db->GetOne("select `uid` from `@#_member_account` where `pay`='手机认证完善奖励' and `type`='1' and `uid`='{$member['uid']}' or `pay`='经验'");
         if (empty($isset_user)) {
             $config = System::load_app_config("user_fufen");
             //夺宝币/经验
             $time = time();
             $this->db->Query("insert into `@#_member_account` (`uid`,`type`,`pay`,`content`,`money`,`time`) values ('{$member['uid']}','1','夺宝币','手机认证完善奖励','{$config['f_overziliao']}','{$time}')");
             $this->db->Query("insert into `@#_member_account` (`uid`,`type`,`pay`,`content`,`money`,`time`) values ('{$member['uid']}','1','经验','手机认证完善奖励','{$config['z_overziliao']}','{$time}')");
             $mysql_model->Query("UPDATE `@#_member` SET `score`=`score`+'{$config['f_overziliao']}',`jingyan`=`jingyan`+'{$config['z_overziliao']}' where uid='" . $member['uid'] . "'");
             $this->db->Query("UPDATE `@#_member` SET score='100' where `uid`='{$member['uid']}'");
         }
         echo "<script type='text/javascript'>alert('验证成功,请重新登录');</script>";
         //_messagemobile("验证成功,请重新登录!",WEB_PATH."/mobile/home");
     } else {
         _messagemobile("页面错误", null, 3);
     }
 }
					<input class="text_password" name="username" type="text"  datatype="m | e" nullmsg="请填写帐号!" errormsg="手机号/邮箱!" />
				</li>
				<li class="ts"><div class="Validform_checktip">手机号/邮箱!</div></li>
				<li>
					<span>密码:</span>					
					<input class="text_password" name="password" type="password"  datatype="*6-20" nullmsg="请设置密码!" errormsg="密码范围在6~20位之间!"/>
					<span class="fog"><a href="<?php 
echo WEB_PATH;
?>
/member/finduser/findpassword">忘记密码?</a></span> 
				</li>								
				<li class="ts" id="pwd_ts"><div class="Validform_checktip">请输入登录密码</div></li>
				<li class="end"><input name="submit" type="submit" value="登录" class="login_init" ></li>
			</ul>
			<?php 
$conn_cfg = System::load_app_config("connect", '', 'api');
?>
            <?php 
if ($conn_cfg['qq']['off']) {
    ?>
 			<div class="loginQQ">使用合作帐号登录:<span id="qq_login_btn"><a href="<?php 
    echo WEB_PATH;
    ?>
/api/qqlogin/"><img src="<?php 
    echo G_TEMPLATES_STYLE;
    ?>
/images/qqlogin.png" /></a></span></div>  
            <?php 
}
?>
			
 public function record()
 {
     $mysql_model = System::load_sys_class('model');
     $member = $this->userinfo;
     $uid = $member['uid'];
     $recount = 0;
     $fufen = System::load_app_config("user_fufen", '', 'member');
     //查询提现记录
     //$recordarr=$mysql_model->GetList("select * from `@#_member_recodes` a left join `@#_member_cashout` b on a.cashoutid=b.id where a.`uid`='$uid' and a.`type`='-3' ORDER BY a.`time` DESC");		$recordarr=
     $recordarr = $mysql_model->GetList("select * from  `@#_member_cashout`  where `uid`='{$uid}' ORDER BY `time` DESC limit 0,30");
     if (!empty($recordarr)) {
         $recount = 1;
     }
     include templates("member", "record");
 }
예제 #10
0
 public function wx_set_config()
 {
     System::load_app_class("admin", G_ADMIN_DIR, 'no');
     $objadmin = new admin();
     $config = System::load_app_config("connect");
     if (isset($_POST['dosubmit'])) {
         $appid = $_POST['appid'];
         $secret = $_POST['secret'];
         $wxid = $_POST['wxid'];
         $key = $_POST['key'];
         $back = $_POST['back'];
         $mappid = $_POST['mappid'];
         $msecret = $_POST['msecret'];
         $mwxid = $_POST['mwxid'];
         $mkey = $_POST['mkey'];
         $mback = $_POST['mback'];
         $this->db->Query("UPDATE `@#_wxset` SET `appid` = '{$appid}',`secret` = '{$secret}',`wxid` = '{$wxid}',`key` = '{$key}',`back` = '{$back}',`mappid` = '{$mappid}',`msecret` = '{$msecret}',`mwxid` = '{$mwxid}',`mkey` = '{$mkey}',`mback` = '{$mback}'");
         _message("配置更新成功!");
     }
     $config = $this->db->GetOne("select * from `@#_wxset` LIMIT 1");
     include $this->tpl(ROUTE_M, 'weixin_set_config');
 }
예제 #11
0
 public function jf_paysubmit()
 {
     $webname = $this->_cfg['web_name'];
     header("Cache-control: private");
     parent::__construct();
     if (!$this->userinfo) {
         header("location: " . WEB_PATH . "/mobile/user/login");
         exit;
     }
     session_start();
     // if(isset($_POST['submitcode'])) {
     // 	if(isset($_SESSION['submitcode'])){
     // 		$submitcode = $_SESSION['submitcode'];
     // 	}else{
     // 		$submitcode = null;
     // 	}
     // 	if($_POST['submitcode'] == $submitcode){
     // 		unset($_SESSION["submitcode"]);
     // 	}else{
     // 		_messagemobile("请不要重复提交...",WEB_PATH.'/mobile/cart/jf_cartlist');
     // 	}
     // }else{
     // 	_messagemobile("正在返回购物车...",WEB_PATH.'/mobile/cart/jf_cartlist');
     // }
     $uid = $this->userinfo['uid'];
     $pay_checkbox = !empty($_POST['moneycheckbox']) ? intval($_POST['moneycheckbox']) : 0;
     $shop_score = !empty($_POST['shop_score']) ? intval($_POST['shop_score']) : 0;
     $jf_use_num = !empty($_POST['jf_use_num']) ? intval($_POST['jf_use_num']) : 0;
     if (!$pay_checkbox && !$shop_score) {
         _messagemobile("请选择支付方式", WEB_PATH . '/mobile/cart/jf_cartlist');
     }
     $fufen = System::load_app_config("user_fufen");
     $fufen['fufen_yuan'] = $fufen['fufen_yuan'] > 0 ? $fufen['fufen_yuan'] : 1;
     if ($shop_score && ($jf_use_num <= 0 || $jf_use_num % $fufen['fufen_yuan'] != 0)) {
         _messagemobile("请正确输入夺宝币数量", WEB_PATH . '/mobile/cart/jf_cartlist');
     }
     if ($pay_checkbox) {
         $payact = 'zh';
     }
     if ($shop_score) {
         $payact = 'jf';
     }
     if ($shop_score && $pay_checkbox) {
         $payact = 'all';
     }
     $pay = System::load_app_class('pay', 'pay');
     $pay->fufen = $shop_score ? $jf_use_num : 0;
     $pay->pay_type_bank = 0;
     $ok = $pay->init($uid, $payact, 'jf_go_record');
     //购买商品
     if ($ok != 'ok') {
         $_COOKIE['Cartlist_jf'] = NULL;
         _setcookie("Cartlist_jf", null);
         _messagemobile("购物车没有商品请<a href='" . WEB_PATH . "/mobile/cart/jf_cartlist' style='color:#22AAFF'>返回购物车</a>查看");
     }
     $check = $pay->jf_go_pay($pay_checkbox);
     if ($check + 100 == 0) {
         _messagemobile("账户余额不足以支付,请<a href='" . WEB_PATH . "/mobile/home/userrecharge' style='color:#22AAFF'>充值</a>");
     }
     if (!$check) {
         _messagemobile("订单添加失败,请<a href='" . WEB_PATH . "/mobile/cart/jf_cartlist' style='color:#22AAFF'>返回购物车</a>查看");
     }
     if ($check) {
         //成功
         header("location: " . WEB_PATH . "/mobile/cart/jf_paysuccess");
     } else {
         //失败
         $_COOKIE['Cartlist_jf'] = NULL;
         _setcookie("Cartlist_jf", null);
         header("location: " . WEB_PATH . "/mobile/mobile");
     }
     exit;
 }
예제 #12
0
 private function pay_bag()
 {
     $time = time();
     $uid = $this->members['uid'];
     $query_1 = $this->set_dingdan('账户', 'A');
     //夺宝币
     $fufen = System::load_app_config("user_fufen", '', 'member');
     if ($this->fufen) {
         if ($fufen['fufen_yuan']) {
             $fufen_dikou = intval($this->fufen / $fufen['fufen_yuan']);
         } else {
             $fufen_dikou = 0;
         }
     } else {
         $fufen_dikou = 0;
     }
     $Money = $this->members['money'] - $this->MoenyCount + $fufen_dikou;
     //还剩金额
     $query_fufen = true;
     $pay_zhifu_name = '账户';
     if ($fufen_dikou) {
         $myfufen = $this->members['score'] - $this->fufen;
         $query_fufen = $this->db->Query("UPDATE `@#_member` SET `score`='{$myfufen}' WHERE (`uid`='{$uid}')");
         $pay_zhifu_name = '夺宝币';
         $this->MoenyCount = $this->fufen;
     } else {
         $myscore = $this->members['score'] + $fufen['f_shoppay'];
         $query_add_fufen_1 = $this->db->Query("UPDATE `@#_member` SET `score`= '{$myscore}' WHERE (`uid`='{$uid}')");
         $query_add_fufen_2 = $this->db->Query("INSERT INTO `@#_member_account` (`uid`, `type`, `pay`, `content`, `money`, `time`) VALUES ('{$uid}', '1', '夺宝币', '购买了商品', '{$fufen['f_shoppay']}', '{$time}')");
         $query_fufen = $query_add_fufen_1 && $query_add_fufen_2;
     }
     $jingyan = $this->members['jingyan'] + $fufen['z_shoppay'];
     $query_jingyan = $this->db->Query("UPDATE `@#_member` SET `jingyan`='{$jingyan}' WHERE (`uid`='{$uid}')");
     //经验值
     $query_2 = $this->db->Query("UPDATE `@#_member` SET `money`='{$Money}' WHERE (`uid`='{$uid}')");
     //金额
     $query_3 = $info = $this->db->GetOne("SELECT * FROM  `@#_member` WHERE (`uid`='{$uid}') LIMIT 1");
     $query_4 = $this->db->Query("INSERT INTO `@#_member_account` (`uid`, `type`, `pay`, `content`, `money`, `time`) VALUES ('{$uid}', '-1', '{$pay_zhifu_name}', '购买了商品', '{$this->MoenyCount}', '{$time}')");
     $query_5 = true;
     $query_insert = true;
     $goods_count_num = 0;
     foreach ($this->shoplist as $shop) {
         if ($shop['canyurenshu'] >= $shop['zongrenshu'] && $shop['maxqishu'] >= $shop['qishu']) {
             $this->db->Query("UPDATE `@#_shoplist` SET `canyurenshu`=`zongrenshu`,`shenyurenshu` = '0' where `id` = '{$shop['id']}'");
         } else {
             $shenyurenshu = $shop['zongrenshu'] - $shop['canyurenshu'];
             $query = $this->db->Query("UPDATE `@#_shoplist` SET `canyurenshu` = '{$shop['canyurenshu']}',`shenyurenshu` = '{$shenyurenshu}' WHERE `id`='{$shop['id']}'");
             if (!$query) {
                 $query_5 = false;
             }
         }
         $goods_count_num += $shop['goods_count_num'];
     }
     $dingdancode = $this->dingdancode;
     $query_6 = $this->db->Query("UPDATE `@#_member_go_record` SET `status`='已付款,未发货' WHERE `code`='{$dingdancode}' and `uid` = '{$uid}'");
     $query_7 = $this->dingdan_query;
     $query_8 = $this->db->Query("UPDATE `@#_caches` SET `value`=`value` + {$goods_count_num} WHERE `key`='goods_count_num'");
     $this->goods_count_num = $goods_count_num;
     if ($query_fufen && $query_jingyan && $query_1 && $query_2 && $query_3 && $query_4 && $query_5 && $query_6 && $query_7 && $query_insert && $query_8) {
         if ($info['money'] == $Money) {
             $this->db->Autocommit_commit();
             foreach ($this->shoplist as $shop) {
                 if ($shop['canyurenshu'] >= $shop['zongrenshu'] && $shop['maxqishu'] >= $shop['qishu']) {
                     $this->db->Autocommit_start();
                     $query_insert = pay_insert_shop($shop, 'add');
                     if (!$query_insert) {
                         $this->db->Autocommit_rollback();
                     } else {
                         $this->db->Autocommit_commit();
                     }
                     $this->db->Query("UPDATE `@#_shoplist` SET `canyurenshu`=`zongrenshu`,`shenyurenshu` = '0' where `id` = '{$shop['id']}'");
                 }
             }
             return true;
         } else {
             $this->db->Autocommit_rollback();
             return false;
         }
     } else {
         $this->db->Autocommit_rollback();
         return false;
     }
 }
$conf = System::load_app_config("user_fufen", '', 'member');
$fufen_to_money = intval($member['score'] / $conf['fufen_yuan']);
?>
                                <?php 
echo $fufen_to_money;
?>
元,1元=<?php 
echo $conf['fufen_yuan'];
?>
福分,
            </span>
            <a href="http://www.gd1yyg.com/help/15" title="如何获得福分?" style="color:#2af;">如何获得福分?</a>
                <!--	<li>			
				<h3>可用金钱:</h3>	<b class="orange">
				<?php 
$conf = System::load_app_config("user_fufen", '', 'member');
$fufen_to_money = intval($member['score'] / $conf['fufen_yuan']);
?>
				<?php 
echo $member['score'];
?>
福分 / <?php 
echo $conf['fufen_yuan'];
?>
福分<h3>(1元=<?php 
echo $conf['fufen_yuan'];
?>
福分)</h3>	 = 
				<?php 
echo $fufen_to_money;
?>
예제 #14
0
 private function pay_bag()
 {
     $time = time();
     $uid = $this->members['uid'];
     $fufen = System::load_app_config("user_fufen", '', 'member');
     $query_1 = $this->set_dingdan('账户', 'A');
     /*会员购买过账户剩余金额*/
     $Money = $this->members['money'] - $this->MoenyCount + $this->fufen_to_money;
     $query_fufen = true;
     $pay_zhifu_name = '账户';
     if ($this->fufen_to_money) {
         $myfufen = $this->members['score'] - $this->fufen;
         $query_fufen = $this->db->Query("UPDATE `@#_member` SET `score`='{$myfufen}' WHERE (`uid`='{$uid}')");
         $pay_zhifu_name = '福分';
         $this->MoenyCount = $this->fufen;
     }
     //添加用户经验
     $jingyan = $this->members['jingyan'] + $fufen['z_shoppay'];
     $query_jingyan = $this->db->Query("UPDATE `@#_member` SET `jingyan`='{$jingyan}' WHERE (`uid`='{$uid}')");
     //经验值
     //更新用户账户金额
     $query_2 = $this->db->Query("UPDATE `@#_member` SET `money`='{$Money}' WHERE (`uid`='{$uid}')");
     //金额
     $query_3 = $info = $this->db->GetOne("SELECT * FROM  `@#_member` WHERE (`uid`='{$uid}') LIMIT 1");
     $query_4 = $this->db->Query("INSERT INTO `@#_member_account` (`uid`, `type`, `pay`, `content`, `money`, `time`) VALUES ('{$uid}', '-1', '{$pay_zhifu_name}', '购买了商品', '{$this->MoenyCount}', '{$time}')");
     $query_5 = true;
     $query_insert = true;
     $goods_count_num = 0;
     foreach ($this->shoplist as $shop) {
         if ($shop['canyurenshu'] >= $shop['zongrenshu'] && $shop['maxqishu'] >= $shop['qishu']) {
             $this->db->Query("UPDATE `@#_shoplist` SET `canyurenshu`=`zongrenshu`,`shenyurenshu` = '0' where `id` = '{$shop['id']}'");
         } else {
             $sellnum = $this->db->GetOne("select sum(gonumber) as sellnum from `@#_member_go_record` where `shopid` = '{$shop['id']}'");
             $sellnum = $sellnum['sellnum'];
             $shenyurenshu = $shop['zongrenshu'] - $sellnum;
             $query = $this->db->Query("UPDATE `@#_shoplist` SET `canyurenshu` = '{$sellnum}',`shenyurenshu` = '{$shenyurenshu}' WHERE `id`='{$shop['id']}'");
             // $shenyurenshu = $shop['zongrenshu'] - $shop['canyurenshu'];
             // $query = $this->db->Query("UPDATE `@#_shoplist` SET `canyurenshu` = '$shop[canyurenshu]',`shenyurenshu` = '$shenyurenshu' WHERE `id`='$shop[id]'");
             if (!$query) {
                 $query_5 = false;
             }
         }
         $goods_count_num += $shop['goods_count_num'];
     }
     //添加福分
     if (!$this->fufen_to_money) {
         $mygoscore = $fufen['f_shoppay'] * $goods_count_num;
         $mygoscore_text = "购买了{$goods_count_num}人次商品";
         $myscore = $this->members['score'] + $mygoscore;
         $query_add_fufen_1 = $this->db->Query("UPDATE `@#_member` SET `score`= '{$myscore}' WHERE (`uid`='{$uid}')");
         $query_add_fufen_2 = $this->db->Query("INSERT INTO `@#_member_account` (`uid`, `type`, `pay`, `content`, `money`, `time`) VALUES ('{$uid}', '1', '福分', '{$mygoscore_text}', '{$mygoscore}', '{$time}')");
         $query_fufen = $query_add_fufen_1 && $query_add_fufen_2;
     }
     $dingdancode = $this->dingdancode;
     $query_6 = $this->db->Query("UPDATE `@#_member_go_record` SET `status`='已付款,未发货,未完成' WHERE `code`='{$dingdancode}' and `uid` = '{$uid}'");
     $query_7 = $this->dingdan_query;
     $query_8 = $this->db->Query("UPDATE `@#_caches` SET `value`=`value` + {$goods_count_num} WHERE `key`='goods_count_num'");
     $this->goods_count_num = $goods_count_num;
     if ($query_fufen && $query_jingyan && $query_1 && $query_2 && $query_3 && $query_4 && $query_5 && $query_6 && $query_7 && $query_insert && $query_8) {
         if ($info['money'] == $Money) {
             $this->db->Autocommit_commit();
             foreach ($this->shoplist as $shop) {
                 if ($shop['canyurenshu'] >= $shop['zongrenshu'] && $shop['maxqishu'] >= $shop['qishu']) {
                     $this->db->Autocommit_start();
                     $query_insert = pay_insert_shop($shop, 'add');
                     if (!$query_insert) {
                         $this->db->Autocommit_rollback();
                     } else {
                         $this->db->Autocommit_commit();
                     }
                     $this->db->Query("UPDATE `@#_shoplist` SET `canyurenshu`=`zongrenshu`,`shenyurenshu` = '0' where `id` = '{$shop['id']}'");
                 }
             }
             return true;
         } else {
             $this->db->Autocommit_rollback();
             return false;
         }
     } else {
         $this->db->Autocommit_rollback();
         return false;
     }
 }
예제 #15
0
 public function qq_set_config()
 {
     System::load_app_class("admin", G_ADMIN_DIR, 'no');
     $objadmin = new admin();
     $config = System::load_app_config("connect");
     if (isset($_POST['dosubmit'])) {
         $qq_off = intval($_POST['type']);
         $qq_id = $_POST['id'];
         $qq_key = $_POST['key'];
         $config['qq'] = array("off" => $qq_off, "id" => $qq_id, "key" => $qq_key);
         $html = var_export($config, true);
         $html = "<?php return " . $html . "; ?>";
         $path = dirname(__FILE__) . '/lib/connect.ini.php';
         if (!is_writable($path)) {
             _message('Please chmod  connect.ini.php  to 0777 !');
         }
         $ok = file_put_contents($path, $html);
         _message("配置更新成功!");
     }
     $config = $config['qq'];
     include $this->tpl(ROUTE_M, 'qq_set_config');
 }
예제 #16
0
파일: pay.fun.php 프로젝트: ping199143/1ydb
function pay_go_yongjin($uid = null, $dingdancode = null)
{
    if (!$uid || !$dingdancode) {
        return true;
    }
    $db = System::load_sys_class("model");
    $time = time();
    $config = System::load_app_config("user_fufen", '', 'member');
    //福分/经验/佣金
    $yesyaoqing = $db->GetOne("SELECT `yaoqing` FROM `@#_member` WHERE `uid`='{$uid}'");
    if ($yesyaoqing['yaoqing']) {
        $yongjin = $config['fufen_yongjin'];
        //每一元返回的佣金
    } else {
        return true;
    }
    $yongjin = floatval(substr(sprintf("%.3f", $yongjin), 0, -1));
    $gorecode = $db->GetList("SELECT * FROM `@#_member_go_record` WHERE `code`='{$dingdancode}'");
    foreach ($gorecode as $val) {
        $y_money = $val['moneycount'] * $yongjin;
        $content = "(第" . $val['shopqishu'] . "期)" . $val['shopname'];
        $db->Query("INSERT INTO `@#_member_recodes`(`uid`,`type`,`content`,`shopid`,`money`,`ygmoney`,`time`)VALUES('{$uid}','1','{$content}','{$val['shopid']}','{$y_money}','{$val['moneycount']}','{$time}' )");
    }
}
예제 #17
0
 public function pay()
 {
     $webname = $this->_cfg['web_name'];
     parent::__construct();
     if (!($member = $this->userinfo)) {
         header("location: " . WEB_PATH . "/mobile/user/login");
     }
     $Mcartlist = json_decode(stripslashes($this->Cartlist), true);
     $shopids = '';
     if (is_array($Mcartlist)) {
         foreach ($Mcartlist as $key => $val) {
             $shopids .= intval($key) . ',';
         }
         $shopids = str_replace(',0', '', $shopids);
         $shopids = trim($shopids, ',');
     }
     $shoplist = array();
     if ($shopids != NULL) {
         $shoplist = $this->db->GetList("SELECT * FROM `@#_shoplist` where `id` in({$shopids})", array("key" => "id"));
     }
     $MoenyCount = 0;
     if (count($shoplist) >= 1) {
         foreach ($Mcartlist as $key => $val) {
             $key = intval($key);
             if (isset($shoplist[$key])) {
                 $shoplist[$key]['cart_gorenci'] = $val['num'] ? $val['num'] : 1;
                 $MoenyCount += $shoplist[$key]['yunjiage'] * $shoplist[$key]['cart_gorenci'];
                 $shoplist[$key]['cart_xiaoji'] = substr(sprintf("%.3f", $shoplist[$key]['yunjiage'] * $val['num']), 0, -1);
                 $shoplist[$key]['cart_shenyu'] = $shoplist[$key]['zongrenshu'] - $shoplist[$key]['canyurenshu'];
             }
         }
         $shopnum = 0;
         //表示有商品
     } else {
         _setcookie('Cartlist', NULL);
         //_message("购物车没有商品!",WEB_PATH);
         $shopnum = 1;
         //表示没有商品
     }
     //总支付价格
     $MoenyCount = substr(sprintf("%.3f", $MoenyCount), 0, -1);
     //会员余额
     $Money = $member['money'];
     //商品数量
     $shoplen = count($shoplist);
     $fufen = System::load_app_config("user_fufen", '', 'member');
     if ($fufen['fufen_yuan']) {
         $fufen_dikou = intval($member['score'] / $fufen['fufen_yuan']);
     } else {
         $fufen_dikou = 0;
     }
     $paylist = $this->db->GetList("select * from `@#_pay` where `pay_start` = '1'");
     session_start();
     $_SESSION['submitcode'] = $submitcode = uniqid();
     include templates("mobile/cart", "payment");
 }