本文整理匯總了PHP中System::load_app_config方法的典型用法代碼示例。如果您正苦於以下問題:PHP System::load_app_config方法的具體用法?PHP System::load_app_config怎麽用?PHP System::load_app_config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System
的用法示例。
在下文中一共展示了System::load_app_config方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
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: commissions
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: jf_paysubmit
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: mobilecheck
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: record
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: paysubmit
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: mobilecheck
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);
}
}
示例8:
<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
}
?>
示例9: record
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: wx_set_config
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: pay_bag
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;
}
}
示例12: intval
$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;
?>
示例13: pay_bag
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;
}
}
示例14: qq_set_config
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');
}
示例15: pay_go_yongjin
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}' )");
}
}