本文整理匯總了PHP中send_user_msg函數的典型用法代碼示例。如果您正苦於以下問題:PHP send_user_msg函數的具體用法?PHP send_user_msg怎麽用?PHP send_user_msg使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了send_user_msg函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
public function index()
{
require_once APP_ROOT_PATH . "system/libs/user.php";
$email = strim($GLOBALS['request']['email']);
$pwd = strim($GLOBALS['request']['pwd']);
$username = strim($GLOBALS['request']['user_name']);
$result = do_login_user($email, $pwd);
$GLOBALS['user_info'] = $user_data = es_session::get('user_info');
if ($GLOBALS['user_info']) {
$user_id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "user where user_name = '" . $username . "'");
$content = htmlspecialchars(addslashes(trim($GLOBALS['request']['message'])));
send_user_msg("", $content, intval($GLOBALS['user_info']['id']), $user_id, get_gmtime());
$root['return'] = 1;
} else {
$root['return'] = 0;
$root['info'] = "請先登錄";
}
output($root);
}
示例2: index
public function index()
{
$root = array();
require_once APP_ROOT_PATH . "system/model/user.php";
$username = strim($GLOBALS['request']['user_name']);
if (strim($GLOBALS['request']['from'] == 'wap')) {
$root['message'] = htmlspecialchars(addslashes(trim($GLOBALS['request']['message'])));
$root['name'] = $GLOBALS['request']['user_name'];
$root['da'] = $GLOBALS['user_info'];
}
if ($GLOBALS['user_info']) {
$user_id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "user where user_name = '" . $username . "'");
$content = htmlspecialchars(addslashes(trim($GLOBALS['request']['message'])));
send_user_msg("", $content, intval($GLOBALS['user_info']['id']), $user_id, get_gmtime());
$root['return'] = 1;
$root['info'] = "發送成功";
} else {
$root['return'] = 0;
$root['info'] = "請先登錄";
}
output($root);
}
示例3: do_reback
function do_reback()
{
require APP_ROOT_PATH . "app/Lib/common.php";
require APP_ROOT_PATH . "app/Lib/deal.php";
$id = intval($_REQUEST['id']);
if ($id == 0) {
$this->error("操作失敗", 0);
die;
}
$id = intval($_REQUEST['id']);
$deal_id = $GLOBALS['db']->getOne("SELECT deal_id FROM " . DB_PREFIX . "deal_load_transfer WHERE id=" . $id);
if ($deal_id == 0) {
$this->error("不存在的債權");
die;
}
$condition = ' AND dlt.id=' . $id . ' AND d.deal_status >= 4 and d.is_effect=1 and d.is_delete=0 and d.loantype = 0 and d.repay_time_type =1 and d.publish_wait=0 ';
$union_sql = " LEFT JOIN " . DB_PREFIX . "deal_load_transfer dlt ON dlt.deal_id = dl.deal_id ";
$transfer = get_transfer($union_sql, $condition);
if ($transfer['t_user_id'] > 0) {
$this->error("債權已轉讓,無法撤銷", 0);
die;
}
$msg = strim($_POST['msg']);
if ($msg == "") {
$this->error("請輸入撤銷原因", 0);
die;
}
$GLOBALS['db']->query("UPDATE " . DB_PREFIX . "deal_load_transfer SET status=0 WHERE id=" . $id);
if ($GLOBALS['db']->affected_rows() > 0) {
$content = "您好,您在" . app_conf("SHOP_TITLE") . "轉讓的債權 “<a href=\"" . url("index", "transfer#detail", array("id" => $id)) . "\">Z-" . $transfer['load_id'] . "</a>” 因為:“" . $msg . "”被管理員撤銷了";
send_user_msg("", $content, 0, $transfer['user_id'], TIME_UTC, 0, true, 17);
$this->success("撤銷成功!");
die;
} else {
$this->success("撤銷失敗!");
die;
}
}
示例4: auto_do_login_user
/**
* 處理cookie的自動登錄
* @param $user_name_or_email 用戶名或郵箱
* @param $user_md5_pwd md5加密過的密碼
*/
function auto_do_login_user($user_name_or_email, $user_md5_pwd)
{
$user_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where (user_name='" . $user_name_or_email . "' or email = '" . $user_name_or_email . "' or mobile = '" . $user_name_or_email . "') and is_delete = 0");
if ($user_data) {
if (md5($user_data['user_pwd'] . "_EASE_COOKIE") == $user_md5_pwd) {
//成功
//登錄成功自動檢測關於會員等級
$user_current_group = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_group where id = " . intval($user_data['group_id']));
$user_group = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_group where score <=" . intval($user_data['score']) . " order by score desc");
if ($user_current_group['score'] < $user_group['score'] && $user_data['group_id'] != $user_group['id']) {
$user_data['group_id'] = intval($user_group['id']);
$GLOBALS['db']->query("update " . DB_PREFIX . "user set level_id = " . $user_data['group_id'] . " where id = " . $user_data['id']);
$pm_title = "您已經成為" . $user_group['name'] . "";
$pm_content = "恭喜您,您已經成為" . $user_group['name'] . "。";
if ($user_group['discount'] < 1) {
$pm_content .= "您將享有" . $user_group['discount'] * 10 . "折的購物優惠";
}
send_user_msg($pm_title, $pm_content, 0, $user_data['id'], TIME_UTC, 0, true, true);
}
$user_current_level = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_level where id = " . intval($user_data['level_id']));
$user_level = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_level where point <=" . intval($user_data['point']) . " order by point desc");
if ($user_current_level['point'] < $user_level['point'] && $user_data['level_id'] != $user_level['id']) {
$user_data['level_id'] = intval($user_level['id']);
$GLOBALS['db']->query("update " . DB_PREFIX . "user set level_id = " . $user_data['level_id'] . " where id = " . $user_data['id']);
$pm_title = "您已經成為" . $user_level['name'] . "";
$pm_content = "恭喜您,您已經成為" . $user_level['name'] . "。";
send_user_msg($pm_title, $pm_content, 0, $user_data['id'], TIME_UTC, 0, true, true);
}
if ($user_current_level['point'] > $user_level['point'] && $user_data['level_id'] != $user_level['id']) {
$user_data['level_id'] = intval($user_level['id']);
$GLOBALS['db']->query("update " . DB_PREFIX . "user set level_id = " . $user_data['level_id'] . " where id = " . $user_data['id']);
$pm_title = "您已經降為" . $user_level['name'] . "";
$pm_content = "很報歉,您已經降為" . $user_level['name'] . "。";
send_user_msg($pm_title, $pm_content, 0, $user_data['id'], TIME_UTC, 0, true, true);
}
es_session::set("user_info", $user_data);
$GLOBALS['user_info'] = $user_data;
//檢測勳章
$medal_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "medal where is_effect = 1 and allow_check = 1");
foreach ($medal_list as $medal) {
$file = APP_ROOT_PATH . "system/medal/" . $medal['class_name'] . "_medal.php";
$cls = $medal['class_name'] . "_medal";
if (file_exists($file)) {
require_once $file;
if (class_exists($cls)) {
$o = new $cls();
$check_result = $o->check_medal();
if ($check_result['status'] == 0) {
send_user_msg($check_result['info'], $check_result['info'], 0, $user_data['id'], TIME_UTC, 0, true, true);
}
}
}
}
$GLOBALS['db']->query("update " . DB_PREFIX . "user set login_ip = '" . get_client_ip() . "',login_time= " . TIME_UTC . ",group_id=" . intval($user_data['group_id']) . " where id =" . $user_data['id']);
}
}
}
示例5: getAuthorizedSaveCarry
function getAuthorizedSaveCarry($amount, $paypassword, $bid)
{
$status = array('status' => 0, 'show_err' => '');
if ($GLOBALS['authorized_info']['id'] > 0) {
$paypassword = strim($paypassword);
$amount = floatval($amount);
$bid = intval($bid);
if ($paypassword == "") {
$status['status'] = 0;
$status['show_err'] = $GLOBALS['lang']['PAYPASSWORD_EMPTY'];
return $status;
}
if (md5($paypassword) != $GLOBALS['authorized_info']['paypassword']) {
$status['status'] = 0;
$status['show_err'] = $GLOBALS['lang']['PAYPASSWORD_ERROR'];
return $status;
}
$data['user_id'] = intval($GLOBALS['authorized_info']['id']);
$data['money'] = $amount;
if ($data['money'] <= 0) {
$status['status'] = 0;
$status['show_err'] = $GLOBALS['lang']['CARRY_MONEY_NOT_TRUE'];
return $status;
}
$fee = 0;
$feel_type = 0;
//獲取手續費配置表
$fee_config = load_auto_cache("user_carry_config");
//如果手續費大於最大的配置那麽取這個手續費
if ($data['money'] >= $fee_config[count($fee_config) - 1]['max_price']) {
$fee = $fee_config[count($fee_config) - 1]['fee'];
$feel_type = $fee_config[count($fee_config) - 1]['fee_type'];
} else {
foreach ($fee_config as $k => $v) {
if ($data['money'] >= $v['min_price'] && $data['money'] <= $v['max_price']) {
$fee = floatval($v['fee']);
$feel_type = $v['fee_type'];
}
}
}
if ($feel_type == 1) {
$fee = $data['money'] * $fee * 0.01;
}
//判斷提現金額限製
if ($data['money'] + $fee + floatval($GLOBALS['user_info']['nmc_amount']) > floatval($GLOBALS['authorized_info']['money'])) {
$status['status'] = 0;
$status['show_err'] = $GLOBALS['lang']['CARRY_MONEY_NOT_ENOUGHT'];
return $status;
}
$data['fee'] = $fee;
if ($bid == 0) {
$status['status'] = 0;
$status['show_err'] = $GLOBALS['lang']['PLASE_ENTER_CARRY_BANK'];
return $status;
}
$user_bank = $GLOBALS['db']->getRow("SELECT * FROM " . DB_PREFIX . "user_bank where user_id=" . intval($GLOBALS['authorized_info']['id']) . " AND id={$bid} ");
$data['bank_id'] = $user_bank['bank_id'];
$data['real_name'] = $user_bank['real_name'];
$data['region_lv1'] = intval($user_bank['region_lv1']);
$data['region_lv2'] = intval($user_bank['region_lv2']);
$data['region_lv3'] = intval($user_bank['region_lv3']);
$data['region_lv4'] = intval($user_bank['region_lv4']);
$data['bankzone'] = trim($user_bank['bankzone']);
$data['bankcard'] = trim($user_bank['bankcard']);
$data['create_time'] = TIME_UTC;
$GLOBALS['db']->autoExecute(DB_PREFIX . "user_carry", $data, "INSERT");
//更新會員賬戶信息
require APP_ROOT_PATH . 'system/libs/user.php';
modify_account(array('money' => -$data['money'], 'lock_money' => $data['money']), $data['user_id'], "提現申請", 8);
modify_account(array('money' => -$fee, 'lock_money' => $fee), $data['user_id'], "提現手續費", 9);
//$content = "您於".to_date($data['create_time'],"Y年m月d日 H:i:s")."提交的".format_price($data['money'])."提現申請我們正在處理,如您填寫的賬戶信息正確無誤,您的資金將會於3個工作日內到達您的銀行賬戶.";
$notice['time'] = to_date($data['create_time'], "Y年m月d日 H:i:s");
$notice['money'] = format_price($data['money']);
$tmpl_content = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "msg_template where name = 'TPL_WITHDRAWS_CASH'", false);
$GLOBALS['tmpl']->assign("notice", $notice);
$content = $GLOBALS['tmpl']->fetch("str:" . $tmpl_content['content']);
send_user_msg("", $content, 0, $data['user_id'], TIME_UTC, 0, true, 5);
$status['status'] = 1;
$status['show_err'] = $GLOBALS['lang']['CARRY_SUBMIT_SUCCESS'];
} else {
$status['show_err'] = "未登錄";
}
return $status;
}
示例6: auto_do_login_user
require_once APP_ROOT_PATH . "system/libs/user.php";
auto_do_login_user($r_user_name, $r_user_pwd);
}
}
$user_info = es_session::get('user_info');
if (intval($user_info['id']) > 0) {
$user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where is_delete = 0 and is_effect = 1 and id = " . intval($user_info['id']));
if ($user_info) {
es_session::set('user_info', $user_info);
$GLOBALS['tmpl']->assign("user_info", $user_info);
if (check_ipop_limit(get_client_ip(), "auto_send_msg", 30, $user_info['id'])) {
//有會員登錄狀態時,自動創建消息
$msg_systems = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "msg_system where (end_time = 0 or end_time > " . TIME_UTC . ") and user_ids = '' or user_ids like '%" . $user_info['id'] . "|%'");
foreach ($msg_systems as $msg) {
if ($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "msg_box where to_user_id = " . $user_info['id'] . " and system_msg_id = " . $msg['id']) == 0) {
send_user_msg($msg['title'], $msg['content'], 0, $user_info['id'], $msg['create_time'], $msg['id'], true);
}
}
}
}
} else {
es_session::set('user_info', array());
}
/*
//保存返利的cookie
if($_REQUEST['r'])
{
$rid = strim(base64_decode($_REQUEST['r']));
$ref_uid = intval($GLOBALS['db']->getOne("select id from ".DB_PREFIX."user where user_name = '".$rid."' OR mobile='".$rid."'"));
es_cookie::set("REFERRAL_USER",intval($ref_uid));
}
示例7: send_deal_success_site_sms
function send_deal_success_site_sms($deal_id, $deal_info = false)
{
if (!$deal_info && $deal_id == 0) {
return false;
}
if (!$deal_info) {
$deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where id = " . $deal_id);
}
if (intval($deal_info['is_send_success_msg']) == 1) {
return false;
}
//獲取投標列表
$load_user_list = $GLOBALS['db']->getAll("SELECT user_name,user_id,create_time FROM " . DB_PREFIX . "deal_load WHERE deal_id=" . $deal_info['id']);
if ($load_user_list) {
foreach ($load_user_list as $k => $v) {
$user_info = $GLOBALS['db']->getRow("select email from " . DB_PREFIX . "user where id = " . $v['user_id']);
$load_msg_conf = get_user_msg_conf($v['user_id']);
if ($load_msg_conf['sms_bidsuccess'] == 1 || !$load_msg_conf) {
$content = "<p>感謝您使用" . app_conf("SHOP_TITLE") . "貸款融資,很高興的通知您,您於" . to_date($v['create_time'], "Y年m月d日") . "投標的借款列表";
$content .= "“<a href=\"" . url("index", "deal", array("id" => $deal_info['id'])) . "\">" . $deal_info['name'] . "</a>”滿標</p>";
send_user_msg("", $content, 0, $v['user_id'], TIME_UTC, 0, true, 16);
}
}
}
}
示例8: add
public function add()
{
$user_info = $GLOBALS['user_info'];
$ajax = intval($_REQUEST['ajax']);
if (!$user_info) {
showErr($GLOBALS['lang']['PLEASE_LOGIN_FIRST'], $ajax);
}
if ($_REQUEST['content'] == '') {
showErr($GLOBALS['lang']['MESSAGE_CONTENT_EMPTY'], $ajax);
}
//驗證碼
if (app_conf("VERIFY_IMAGE") == 1) {
$verify = md5(trim($_REQUEST['verify']));
$session_verify = es_session::get('verify');
if ($verify != $session_verify) {
showErr($GLOBALS['lang']['VERIFY_CODE_ERROR'], $ajax);
}
}
if (!check_ipop_limit(get_client_ip(), "message", intval(app_conf("SUBMIT_DELAY")), 0)) {
showErr($GLOBALS['lang']['MESSAGE_SUBMIT_FAST'], $ajax);
}
$rel_table = strim($_REQUEST['rel_table']);
$message_type = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "message_type where type_name='" . $rel_table . "'");
if (!$message_type) {
showErr($GLOBALS['lang']['INVALID_MESSAGE_TYPE'], $ajax);
}
//添加留言
$message['title'] = $_REQUEST['title'] ? strim($_REQUEST['title']) : btrim(valid_str($_REQUEST['content']));
$message['content'] = btrim(valid_str($_REQUEST['content']));
$message['title'] = valid_str($message['title']);
$message['create_time'] = TIME_UTC;
$message['rel_table'] = $rel_table;
$message['rel_id'] = intval($_REQUEST['rel_id']);
$message['user_id'] = intval($GLOBALS['user_info']['id']);
if (app_conf("USER_MESSAGE_AUTO_EFFECT") == 0) {
$message_effect = 0;
} else {
$message_effect = $message_type['is_effect'];
}
$message['is_effect'] = $message_effect;
$GLOBALS['db']->autoExecute(DB_PREFIX . "message", $message);
$l_user_id = $GLOBALS['db']->getOne("SELECT user_id FROM " . DB_PREFIX . "deal WHERE id=" . $message['rel_id']);
//添加到動態
insert_topic($rel_table . "_message", $message['rel_id'], $message['user_id'], $GLOBALS['user_info']['user_name'], $l_user_id);
if ($rel_table == "deal") {
require_once APP_ROOT_PATH . 'app/Lib/deal.php';
$deal = get_deal($message['rel_id']);
//自己給自己留言不執行操作
if ($deal['user_id'] != $message['user_id']) {
$msg_conf = get_user_msg_conf($deal['user_id']);
//站內信
if ($msg_conf['sms_asked'] == 1) {
$content = "<p>您好,用戶 " . get_user_name($message['user_id']) . "對您發布的借款列表 “<a href=\"" . $deal['url'] . "\">" . $deal['name'] . "</a>”進行了以下留言:</p>";
$content .= "<p>“" . $message['content'] . "”</p>";
send_user_msg("", $content, 0, $deal['user_id'], TIME_UTC, 0, true, 13, $message['rel_id']);
}
//郵件
if ($msg_conf['mail_asked'] == 1 && app_conf('MAIL_ON') == 1) {
$user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $deal['user_id']);
$tmpl = $GLOBALS['db']->getRowCached("select * from " . DB_PREFIX . "msg_template where name = 'TPL_MAIL_DEAL_MSG'");
$tmpl_content = $tmpl['content'];
$notice['user_name'] = $user_info['user_name'];
$notice['msg_user_name'] = get_user_name($message['user_id'], false);
$notice['deal_name'] = $deal['name'];
$notice['deal_url'] = SITE_DOMAIN . url("index", "deal", array("id" => $deal['id']));
$notice['message'] = $message['content'];
$notice['site_name'] = app_conf("SHOP_TITLE");
$notice['site_url'] = SITE_DOMAIN . APP_ROOT;
$notice['help_url'] = SITE_DOMAIN . url("index", "helpcenter");
$GLOBALS['tmpl']->assign("notice", $notice);
$msg = $GLOBALS['tmpl']->fetch("str:" . $tmpl_content);
$msg_data['dest'] = $user_info['email'];
$msg_data['send_type'] = 1;
$msg_data['title'] = get_user_name($message['user_id'], false) . "給您的標留言!";
$msg_data['content'] = addslashes($msg);
$msg_data['send_time'] = 0;
$msg_data['is_send'] = 0;
$msg_data['create_time'] = TIME_UTC;
$msg_data['user_id'] = $user_info['id'];
$msg_data['is_html'] = $tmpl['is_html'];
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_msg_list", $msg_data);
//插入
}
}
}
showSuccess($GLOBALS['lang']['MESSAGE_POST_SUCCESS'], $ajax);
}
示例9: do_login_user
/**
* 處理會員登錄
* @param $user_name_or_email 用戶名或郵箱地址
* @param $user_pwd 密碼
*
*/
function do_login_user($phone, $user_pwd)
{
$user_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where mobile= " . $phone . " and is_delete = 0");
if (!$user_data) {
$result['status'] = 0;
$result['data'] = ACCOUNT_NO_EXIST_ERROR;
return $result;
} else {
$result['user'] = $user_data;
if ($user_data['is_effect'] != 1) {
$result['status'] = 0;
$result['data'] = ACCOUNT_NO_VERIFY_ERROR;
return $result;
} else {
if (intval($result['status']) == 0) {
$result['status'] = 1;
}
//登錄成功自動檢測關於會員等級以及自動登錄商家
$account_name = $user_data['merchant_name'];
$account = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "supplier_account where account_name = '" . $account_name . "' and is_effect = 1 and is_delete = 0");
if ($account) {
/*$account_locations = $GLOBALS['db']->getAll("select location_id from ".DB_PREFIX."supplier_account_location_link where account_id = ".$account['id']);
*
*/
$account_locations = $GLOBALS['db']->getAll("select id from " . DB_PREFIX . "supplier_location where supplier_id = " . $account['supplier_id']);
$account_location_ids = array(0);
foreach ($account_locations as $row) {
$account_location_ids[] = $row['id'];
}
$account['location_ids'] = $account_location_ids;
es_session::set("account_info", $account);
$GLOBALS['db']->query("update " . DB_PREFIX . "supplier_account set login_ip = '" . get_client_ip() . "' where id=" . $account['id']);
}
$user_current_group = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_group where id = " . intval($user_data['group_id']));
$user_group = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_group where score <=" . intval($user_data['score']) . " order by score desc");
if ($user_current_group['score'] < $user_group['score']) {
$user_data['group_id'] = intval($user_group['id']);
$GLOBALS['db']->query("update " . DB_PREFIX . "user set group_id = " . $user_data['group_id'] . " where id = " . $user_data['id']);
$pm_title = "您已經成為" . $user_group['name'] . "";
$pm_content = "恭喜您,您已經成為" . $user_group['name'] . "。";
if ($user_group['discount'] < 1) {
$pm_content .= "您將享有" . $user_group['discount'] * 10 . "折的購物優惠";
}
send_user_msg($pm_title, $pm_content, 0, $user_data['id'], get_gmtime(), 0, true, true);
}
$user_current_level = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_level where id = " . intval($user_data['level_id']));
$user_level = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_level where point <=" . intval($user_data['point']) . " order by point desc");
if ($user_current_level['point'] < $user_level['point']) {
$user_data['level_id'] = intval($user_level['id']);
$GLOBALS['db']->query("update " . DB_PREFIX . "user set level_id = " . $user_data['level_id'] . " where id = " . $user_data['id']);
$pm_title = "您已經成為" . $user_level['name'] . "";
$pm_content = "恭喜您,您已經成為" . $user_level['name'] . "。";
send_user_msg($pm_title, $pm_content, 0, $user_data['id'], get_gmtime(), 0, true, true);
}
if ($user_current_level['point'] > $user_level['point']) {
$user_data['level_id'] = intval($user_level['id']);
$GLOBALS['db']->query("update " . DB_PREFIX . "user set level_id = " . $user_data['level_id'] . " where id = " . $user_data['id']);
$pm_title = "您已經降為" . $user_level['name'] . "";
$pm_content = "很報歉,您已經降為" . $user_level['name'] . "。";
send_user_msg($pm_title, $pm_content, 0, $user_data['id'], get_gmtime(), 0, true, true);
}
es_session::set("user_info", $user_data);
$GLOBALS['user_info'] = $user_data;
//檢測勳章
$medal_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "medal where is_effect = 1 and allow_check = 1");
foreach ($medal_list as $medal) {
$file = APP_ROOT_PATH . "system/medal/" . $medal['class_name'] . "_medal.php";
$cls = $medal['class_name'] . "_medal";
if (file_exists($file)) {
require_once $file;
if (class_exists($cls)) {
$o = new $cls();
$check_result = $o->check_medal();
if ($check_result['status'] == 0) {
send_user_msg($check_result['info'], $check_result['info'], 0, $user_data['id'], get_gmtime(), 0, true, true);
}
}
}
}
$GLOBALS['db']->query("update " . DB_PREFIX . "user set login_ip = '" . get_client_ip() . "',login_time= " . get_gmtime() . ",group_id=" . intval($user_data['group_id']) . " where id =" . $user_data['id']);
//更新購物車
$GLOBALS['db']->query("update " . DB_PREFIX . "deal_cart set user_id = " . intval($user_data['id']) . " where session_id = '" . es_session::id() . "'");
$s_api_user_info = es_session::get("api_user_info");
if ($s_api_user_info) {
$GLOBALS['db']->query("update " . DB_PREFIX . "user set " . $s_api_user_info['field'] . " = '" . $s_api_user_info['id'] . "' where id = " . $user_data['id'] . " and (" . $s_api_user_info['field'] . " = 0 or " . $s_api_user_info['field'] . "='')");
es_session::delete("api_user_info");
}
$result['step'] = intval($user_data["step"]);
return $result;
}
}
}
示例10: send_deal_success_site_sms
function send_deal_success_site_sms($deal_id, $deal_info = false)
{
if (!$deal_info && $deal_id == 0) {
return false;
}
if (!$deal_info) {
$deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where id = " . $deal_id);
}
if (intval($deal_info['is_send_success_msg']) == 1) {
return false;
}
//獲取投標列表
$load_user_list = $GLOBALS['db']->getAll("SELECT user_name,user_id,create_time FROM " . DB_PREFIX . "deal_load WHERE deal_id=" . $deal_info['id']);
if ($load_user_list) {
foreach ($load_user_list as $k => $v) {
$user_info = $GLOBALS['db']->getRow("select email from " . DB_PREFIX . "user where id = " . $v['user_id']);
$load_msg_conf = get_user_msg_conf($v['user_id']);
if ($load_msg_conf['sms_bidsuccess'] == 1 || !$load_msg_conf) {
$notice['shop_title'] = app_conf("SHOP_TITLE");
$notice['time'] = to_date($v['create_time'], "Y年m月d日");
$notice['deal_name'] = "“<a href=\"" . url("index", "deal", array("id" => $deal_info['id'])) . "\">" . $deal_info['name'] . "</a>”";
$tmpl_content = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "msg_template where name = 'TPL_DEAL_SUCCESS_SITE_SMS'", false);
$GLOBALS['tmpl']->assign("notice", $notice);
$content = $GLOBALS['tmpl']->fetch("str:" . $tmpl_content['content']);
send_user_msg("", $content, 0, $v['user_id'], TIME_UTC, 0, true, 16);
}
}
}
}
示例11: dotrans_ok
function dotrans_ok($transfer_id)
{
$transfer = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_load_transfer where id = " . $transfer_id);
//發送消息
$msg_conf = get_user_msg_conf($transfer['user_id']);
if ($msg_conf['sms_transfer'] == 1 || $msg_conf['mail_transfer'] == 1) {
$transfer['tuser'] = get_user("user_name,email", $transfer['t_user_id']);
$transfer['user'] = get_user("user_name,email", $transfer['user_id']);
}
if ($msg_conf['sms_transfer'] == 1) {
$content = "您好,您在" . app_conf("SHOP_TITLE") . "的債權 “<a href=\"" . url("index", "transfer#detail", array("id" => $transfer['id'])) . "\">Z-" . $transfer['load_id'] . "</a>” 成功轉讓給:<a href=\"" . $transfer['tuser']['url'] . "\">" . $transfer['tuser']['user_name'] . "</a>";
send_user_msg("", $content, 0, $transfer['user_id'], TIME_UTC, 0, true, 18);
}
//郵件
if ($msg_conf['mail_transfer'] == 1 && app_conf('MAIL_ON') == 1) {
$tmpl = $GLOBALS['db']->getRowCached("select * from " . DB_PREFIX . "msg_template where name = 'TPL_MAIL_TRANSFER_SUCCESS'");
$tmpl_content = $tmpl['content'];
$notice['user_name'] = $transfer['user']['user_name'];
$notice['transfer_time'] = to_date($transfer['create_time'], "Y年m月d日");
$notice['transfer_id'] = "Z-" . $transfer['load_id'];
$notice['deal_url'] = SITE_DOMAIN . url("index", "transfer#detail", array("id" => $transfer['id']));
$notice['site_name'] = app_conf("SHOP_TITLE");
$notice['site_url'] = SITE_DOMAIN . APP_ROOT;
$notice['help_url'] = SITE_DOMAIN . url("index", "helpcenter");
$notice['msg_cof_setting_url'] = SITE_DOMAIN . url("index", "uc_msg#setting");
$GLOBALS['tmpl']->assign("notice", $notice);
$msg = $GLOBALS['tmpl']->fetch("str:" . $tmpl_content);
$msg_data['dest'] = $transfer['user']['email'];
$msg_data['send_type'] = 1;
$msg_data['title'] = "“債權:Z-" . $transfer['load_id'] . "”轉讓通知";
$msg_data['content'] = addslashes($msg);
$msg_data['send_time'] = 0;
$msg_data['is_send'] = 0;
$msg_data['create_time'] = TIME_UTC;
$msg_data['user_id'] = $transfer['user_id'];
$msg_data['is_html'] = $tmpl['is_html'];
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_msg_list", $msg_data);
//插入
}
if (app_conf('SMS_ON') == 1) {
$tmpl = $GLOBALS['db']->getRowCached("select * from " . DB_PREFIX . "msg_template where name = 'TPL_SMS_TRANSFER_SUCCESS'");
$tmpl_content = $tmpl['content'];
$notice['user_name'] = $transfer['user']['user_name'];
$notice['transfer_time'] = to_date($transfer['create_time'], "Y年m月d日");
$notice['transfer_id'] = "Z-" . $transfer['load_id'];
$notice['site_name'] = app_conf("SHOP_TITLE");
$GLOBALS['tmpl']->assign("notice", $notice);
$msg = $GLOBALS['tmpl']->fetch("str:" . $tmpl_content);
$msg_data['dest'] = $transfer['user']['mobile'];
$msg_data['send_type'] = 0;
$msg_data['title'] = "“債權:Z-" . $transfer['load_id'] . "”轉讓通知";
$msg_data['content'] = addslashes($msg);
$msg_data['send_time'] = 0;
$msg_data['is_send'] = 0;
$msg_data['create_time'] = TIME_UTC;
$msg_data['user_id'] = $transfer['user_id'];
$msg_data['is_html'] = $tmpl['is_html'];
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_msg_list", $msg_data);
//插入
}
//發送債權協議
send_transfer_contract_email($transfer_id);
}
示例12: reply
public function reply()
{
$return["status"] = 0;
if (!$GLOBALS['user_info']) {
$return["status"] = 2;
$return["message"] = $GLOBALS['LANG']["PLEASE_LOGIN_FIRST"];
ajax_return($return);
exit;
}
//驗證碼
if (app_conf("VERIFY_IMAGE") == 1) {
$verify = md5(trim($_REQUEST['verify']));
$session_verify = es_session::get('verify');
if ($verify != $session_verify) {
$return["message"] = $GLOBALS['lang']['VERIFY_CODE_ERROR'];
ajax_return($return);
exit;
}
}
$content = htmlspecialchars(addslashes(valid_str($_REQUEST['content'])));
$uid = intval($GLOBALS["user_info"]['id']);
$pid = intval($_REQUEST['pid']);
$dp_id = intval($_REQUEST['dp_id']);
$page = intval($_REQUEST['page']);
if (!check_ipop_limit(get_client_ip(), "dpsign", 10, $dp_id)) {
$return['message'] = '請勿頻繁回應';
ajax_return($return);
exit;
}
es_session::delete("verify");
$dp_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "supplier_location_dp where id = " . $dp_id);
$merchant_info = $GLOBALS['db']->getRow("select name,id from " . DB_PREFIX . "supplier_location where id = " . $dp_info['supplier_location_id']);
$reply_data = array();
$reply_data['dp_id'] = $dp_id;
$reply_data['content'] = $content;
$reply_data['user_id'] = $uid;
$reply_data['parent_id'] = $pid;
$reply_data['create_time'] = get_gmtime();
$GLOBALS['db']->autoExecute(DB_PREFIX . "supplier_location_dp_reply", $reply_data, "INSERT");
$rid = $GLOBALS['db']->insert_id();
if ($rid > 0) {
$syn_reply = intval($_REQUEST['syn_reply']);
if ($syn_reply == 1) {
$s_account_info = es_session::get("account_info");
if (in_array($dp_info['supplier_location_id'], $s_account_info['location_ids']) && $dp_info['from_data'] != "") {
//驗證通過
$message_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "message where id = " . intval($dp_info['message_id']));
if ($message_info) {
$message_info['admin_reply'] = $content;
$message_info['update_time'] = get_gmtime();
$GLOBALS['db']->autoExecute(DB_PREFIX . "message", $message_info, "UPDATE", "id=" . $message_info['id']);
send_user_msg("商戶回複了你的點評", "商戶回複了你的點評 [<a href='" . url("youhui", "review#detail", array("id" => $dp_info['id'])) . "' target='_blank'>" . $dp_info['title'] . "</a>]", 0, $dp_info['user_id'], get_gmtime(), 0, 1, 1);
}
}
}
increase_user_active(intval($GLOBALS['user_info']['id']), "回應了一則商戶點評");
$GLOBALS['db']->query("update " . DB_PREFIX . "supplier_location_dp set reply_count = reply_count + 1 where id = " . $dp_id);
}
//輸出回應列表
$sql_count = "select count(*) from " . DB_PREFIX . "supplier_location_dp_reply where dp_id = " . $dp_id;
$count = $GLOBALS['db']->getOne($sql_count);
$page_size = app_conf("PAGE_SIZE");
if ($page == 0) {
$page = 1;
}
$limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
$sql = "select * from " . DB_PREFIX . "supplier_location_dp_reply where dp_id = " . $dp_id . " order by create_time desc limit " . $limit;
$reply_list = $GLOBALS['db']->getAll($sql);
foreach ($reply_list as $k => $v) {
$reply_list[$k]['user_name'] = $GLOBALS['db']->getOne("select user_name from " . DB_PREFIX . "user where id = " . $v['user_id']);
$reply_list[$k]['create_time_format'] = pass_date($v['create_time']);
}
$GLOBALS['current_url'] = $_SERVER['REQUEST_URI'] = url("youhui", "review#detail", array("id" => $dp_id));
$page = new Page($count, $page_size);
//初始化分頁對象
$p = $page->show();
$GLOBALS['tmpl']->assign('pages', $p);
$GLOBALS['tmpl']->assign("reply_list", $reply_list);
$GLOBALS['tmpl']->assign('user_auth', get_user_auth());
$html = decode_topic($GLOBALS['tmpl']->fetch("inc/review/reply_list.html"));
$return = array("status" => 1, "message" => $html);
ajax_return($return);
exit;
}
示例13: savedebit
//.........這裏部分代碼省略.........
//推薦人
$work_id = strim($_REQUEST["work_id"]);
if ($work_id) {
$data["admin_id"] = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "admin where work_id = '" . $work_id . "'");
}
$module = "INSERT";
$jumpurl = url("debit", "debit_uc_center#order");
$condition = "";
$deal_id = $GLOBALS['db']->getOne("SELECT id FROM " . DB_PREFIX . "deal WHERE ((is_delete=2 or is_delete=3) or (is_delete=0 and publish_wait=1)) AND user_id=" . $GLOBALS['user_info']['id']);
if ($deal_id > 0) {
$module = "UPDATE";
if ($t == "save") {
$jumpurl = url("debit", "debit_uc_center#order");
}
$condition = "id = {$deal_id}";
} else {
if ($t == "save") {
$jumpurl = url("debit", "debit_uc_center#order");
}
}
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal", $data, $module, $condition);
if ($module == "INSERT") {
$deal_id = $GLOBALS['db']->insert_id();
}
require_once APP_ROOT_PATH . 'app/Lib/deal.php';
$deal = get_deal($deal_id);
//發送驗證通知
if ($t != "save" && trim(app_conf('CUSTOM_SERVICE')) != '' && ($GLOBALS['user_info']['idcardpassed'] == 0 || $GLOBALS['user_info']['incomepassed'] == 0 || $GLOBALS['user_info']['creditpassed'] == 0 || $GLOBALS['user_info']['workpassed'] == 0)) {
$ulist = explode(",", trim(app_conf('CUSTOM_SERVICE')));
$ulist = array_filter($ulist);
if ($ulist) {
$uuid = $ulist[array_rand($ulist)];
if ($uuid > 0) {
$content = app_conf("SHOP_TITLE") . "用戶您好,請盡快上傳必要信用認證材料(包括身份證認證、工作認證、收入認證、信用報告認證)。另外,多上傳一些可選信用認證,有助於您提高借款額度,也有利於出借人更多的了解您的情況,以便讓您更快的籌集到所需的資金。請您點擊'我要貸款',之後點擊相應的審核項目,進入後,可先閱讀該項信用認證所需材料及要求,然後按要求上傳資料即可。 如果您有任何問題請您撥打客服電話 " . app_conf('SHOP_TEL') . " 或給客服郵箱發郵件 " . app_conf("REPLY_ADDRESS") . " 我們會及時給您回複。";
require_once APP_ROOT_PATH . 'app/Lib/message.php';
//添加留言
$message['title'] = $content;
$message['content'] = htmlspecialchars(addslashes(valid_str($content)));
$message['title'] = valid_str($message['title']);
$message['create_time'] = TIME_UTC;
$message['rel_table'] = "deal";
$message['rel_id'] = $deal_id;
$message['user_id'] = $uuid;
$message['is_effect'] = 1;
$GLOBALS['db']->autoExecute(DB_PREFIX . "message", $message);
//添加到動態
insert_topic("message", $message['rel_id'], $message['user_id'], get_user_name($message['user_id'], false), $GLOBALS['user_info']['id']);
//自己給自己留言不執行操作
if ($deal['user_id'] != $message['user_id']) {
$msg_conf = get_user_msg_conf($deal['user_id']);
//站內信
if ($msg_conf['sms_asked'] == 1) {
$notices['shop_title'] = app_conf("SHOP_TITLE");
$notices['shop_tel'] = app_conf('SHOP_TEL');
$notices['shop_address'] = app_conf("REPLY_ADDRESS");
/*{$notice.shop_title}用戶您好,請盡快上傳必要信用認證材料(包括身份證認證、工作認證、收入認證、信用報告認證)。另外,多上傳一些可選信用認證,有助於您提高借款額度,也有利於出借人更多的了解您的情況,以便讓您更快的籌集到所需的資金。請您點擊'我要貸款',之後點擊相應的審核項目,進入後,可先閱讀該項信用認證所需材料及要求,然後按要求上傳資料即可。 如果您有任何問題請您撥打客服電話{$notice.shop_tel}或給客服郵箱發郵件{$notice.shop_address}我們會及時給您回複。*/
$notices['url'] = "“<a href=\"" . $deal_info['url'] . "\">" . $deal_info['name'] . "</a>”";
$notices['user_name'] = get_user_name($message['user_id']);
$notices['money'] = $user_load_data['true_repay_money'] + $user_load_data['impose_money'];
$tmpl_content = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "msg_template where name = 'TPL_WORDS_MSG'", false);
$GLOBALS['tmpl']->assign("notice", $notices);
$contents = $GLOBALS['tmpl']->fetch("str:" . $tmpl_content['content']);
send_user_msg("", $contents, 0, $deal['user_id'], TIME_UTC, 0, true, 13, $message['rel_id']);
}
//郵件
if ($msg_conf['mail_asked'] == 1 && app_conf('MAIL_ON') == 1) {
$tmpl = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "msg_template where name = 'TPL_MAIL_DEAL_MSG'");
$tmpl_content = $tmpl['content'];
$notice['user_name'] = $GLOBALS['user_info']['user_name'];
$notice['msg_user_name'] = get_user_name($message['user_id'], false);
$notice['deal_name'] = $deal['name'];
$notice['deal_url'] = SITE_DOMAIN . url("index", "deal", array("id" => $deal['id']));
$notice['message'] = $message['content'];
$notice['site_name'] = app_conf("SHOP_TITLE");
$notice['site_url'] = SITE_DOMAIN . APP_ROOT;
$notice['help_url'] = SITE_DOMAIN . url("index", "helpcenter");
$GLOBALS['tmpl']->assign("notice", $notice);
$msg = $GLOBALS['tmpl']->fetch("str:" . $tmpl_content);
$msg_data['dest'] = $GLOBALS['user_info']['email'];
$msg_data['send_type'] = 1;
$msg_data['title'] = get_user_name($message['user_id'], false) . "給您的標留言!";
$msg_data['content'] = addslashes($msg);
$msg_data['send_time'] = 0;
$msg_data['is_send'] = 0;
$msg_data['create_time'] = TIME_UTC;
$msg_data['user_id'] = $GLOBALS['user_info']['id'];
$msg_data['is_html'] = $tmpl['is_html'];
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_msg_list", $msg_data);
//插入
}
}
}
}
}
if ($is_ajax == 1) {
showSuccess("提交成功,請等待管理員審核", $is_ajax, $jumpurl);
} else {
app_redirect($jumpurl);
}
}
示例14: do_site_repay
//.........這裏部分代碼省略.........
modify_account(array("money" => -$user_load_data['manage_money']), $in_user_id, "標:" . $deal_info['id'] . ",期:" . ($kk + 1) . ",投標管理費");
}
$msg_conf = get_user_msg_conf($in_user_id);
//短信通知
if (app_conf("SMS_ON") == 1 && app_conf('SMS_REPAY_TOUSER_ON') == 1) {
$tmpl = $GLOBALS['db']->getRowCached("select * from " . DB_PREFIX . "msg_template where name = 'TPL_DEAL_LOAD_REPAY_SMS'");
$tmpl_content = $tmpl['content'];
$notice['user_name'] = $loan_user_info['user_name'];
$notice['deal_name'] = $deal_info['sub_name'];
$notice['deal_url'] = $deal_info['url'];
$notice['site_name'] = app_conf("SHOP_TITLE");
$notice['repay_money'] = number_format($vv['month_repay_money'] + $vv['impose_money'], 2);
if ($unext_loan) {
$notice['need_next_repay'] = $unext_loan;
$notice['next_repay_time'] = to_date($unext_loan['repay_day'], "Y年m月d日");
$notice['next_repay_money'] = number_format($unext_loan['month_repay_money'], 2);
} else {
$notice['all_repay_money'] = $all_repay_money;
$notice['impose_money'] = $all_impose_money;
}
$GLOBALS['tmpl']->assign("notice", $notice);
$sms_content = $GLOBALS['tmpl']->fetch("str:" . $tmpl_content);
$msg_data['dest'] = $loan_user_info['mobile'];
$msg_data['send_type'] = 0;
$msg_data['title'] = $msg_data['content'] = addslashes($sms_content);
$msg_data['send_time'] = 0;
$msg_data['is_send'] = 0;
$msg_data['create_time'] = TIME_UTC;
$msg_data['user_id'] = $in_user_id;
$msg_data['is_html'] = 0;
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_msg_list", $msg_data);
//插入
}
//站內信
if ($msg_conf['sms_bidrepaid'] == 1) {
send_user_msg("", $content, 0, $in_user_id, TIME_UTC, 0, true, 9);
}
//郵件
if ($msg_conf['mail_bidrepaid'] == 1 && app_conf('MAIL_ON') == 1) {
$tmpl = $GLOBALS['db']->getRowCached("select * from " . DB_PREFIX . "msg_template where name = 'TPL_DEAL_LOAD_REPAY_EMAIL'");
$tmpl_content = $tmpl['content'];
$notice['user_name'] = $loan_user_info['user_name'];
$notice['deal_name'] = $deal_info['sub_name'];
$notice['deal_url'] = $deal_info['url'];
$notice['site_name'] = app_conf("SHOP_TITLE");
$notice['site_url'] = SITE_DOMAIN . APP_ROOT;
$notice['help_url'] = SITE_DOMAIN . url("index", "helpcenter");
$notice['msg_cof_setting_url'] = SITE_DOMAIN . url("index", "uc_msg#setting");
$notice['repay_money'] = number_format($vv['month_repay_money'] + $vv['impose_money'], 2);
if ($unext_loan) {
$notice['need_next_repay'] = $unext_loan;
$notice['next_repay_time'] = to_date($unext_loan['repay_day'], "Y年m月d日");
$notice['next_repay_money'] = number_format($unext_loan['month_repay_money'], 2);
} else {
$notice['all_repay_money'] = $all_repay_money;
$notice['impose_money'] = $all_impose_money;
}
$GLOBALS['tmpl']->assign("notice", $notice);
$msg = $GLOBALS['tmpl']->fetch("str:" . $tmpl_content);
$msg_data['dest'] = $loan_user_info['email'];
$msg_data['send_type'] = 1;
$msg_data['title'] = "“" . $deal_info['name'] . "”回款通知";
$msg_data['content'] = addslashes($msg);
$msg_data['send_time'] = 0;
$msg_data['is_send'] = 0;
$msg_data['create_time'] = TIME_UTC;
$msg_data['user_id'] = $in_user_id;
$msg_data['is_html'] = $tmpl['is_html'];
$GLOBALS['db']->autoExecute(DB_PREFIX . "deal_msg_list", $msg_data);
//插入
}
}
}
}
}
if ($page >= $page_all) {
$s_count = $GLOBALS['db']->getOne("SELECT count(*) FROM " . DB_PREFIX . "deal_load_repay where deal_id=" . $id . " AND l_key=" . $l_key . " and has_repay = 0");
if ($s_count == 0) {
$rs_sum = $GLOBALS['db']->getRow("SELECT sum(repay_money) as total_repay_money,sum(manage_money) as total_manage_money,sum(impose_money) as total_impose_money,sum(repay_manage_impose_money) as total_repay_manage_impose_money FROM " . DB_PREFIX . "deal_load_repay where deal_id=" . $id . " AND l_key=" . $l_key . " and has_repay = 1");
$deal_load_list = get_deal_load_list($deal_info);
$GLOBALS['db']->query("UPDATE " . DB_PREFIX . "deal_repay set status = " . ($deal_load_list[$l_key]['status'] - 1) . ",true_repay_time = " . TIME_UTC . ", has_repay = 1, impose_money='" . floatval($rs_sum['total_impose_money']) . "',mange_impose_money='" . floatval($rs_sum['total_repay_manage_impose_money']) . "' where deal_id=" . $id . " AND l_key=" . $l_key . " and has_repay = 0");
if ($GLOBALS['db']->getOne("SELECT count(*) FROM " . DB_PREFIX . "generation_repay WHERE deal_id=" . $id . " AND repay_id=" . $deal_load_list[$l_key]['repay_id'] . "") == 0) {
$generation_repay['deal_id'] = $id;
$generation_repay['repay_id'] = $deal_load_list[$l_key]['repay_id'];
$adm_session = es_session::get(md5(conf("AUTH_KEY")));
$generation_repay['admin_id'] = $adm_session['adm_id'];
$generation_repay['agency_id'] = $deal_info['agency_id'];
$generation_repay['repay_money'] = $rs_sum['total_repay_money'];
$generation_repay['impose_money'] = $rs_sum['total_impose_money'];
$generation_repay['manage_money'] = $rs_sum['total_manage_money'];
$generation_repay['manage_impose_money'] = $rs_sum['total_repay_manage_impose_money'];
$generation_repay['create_time'] = TIME_UTC;
$GLOBALS['db']->autoExecute(DB_PREFIX . "generation_repay", $generation_repay);
}
}
$this->success("代還款執行完畢!");
} else {
register_shutdown_function(array(&$this, 'do_site_repay'), $page + 1);
}
}
示例15: do_reback
function do_reback()
{
$id = intval($_REQUEST['id']);
if ($id == 0) {
$this->error("操作失敗", 0);
die;
}
$id = intval($_REQUEST['id']);
$deal_id = $GLOBALS['db']->getOne("SELECT deal_id FROM " . DB_PREFIX . "deal_load_transfer WHERE id=" . $id);
if ($deal_id == 0) {
$this->error("不存在的債權");
die;
}
$condition = ' AND dlt.id=' . $id . ' AND d.deal_status >= 4 and d.is_effect=1 and d.is_delete=0 and d.repay_time_type =1 and d.publish_wait=0 ';
$union_sql = " LEFT JOIN " . DB_PREFIX . "deal_load_transfer dlt ON dlt.deal_id = dl.deal_id ";
$transfer = get_transfer($union_sql, $condition);
if ($transfer['t_user_id'] > 0) {
$this->error("債權已轉讓,無法撤銷", 0);
die;
}
$msg = strim($_POST['msg']);
if ($msg == "") {
$this->error("請輸入撤銷原因", 0);
die;
}
$GLOBALS['db']->query("UPDATE " . DB_PREFIX . "deal_load_transfer SET status=0 WHERE id=" . $id);
if ($GLOBALS['db']->affected_rows() > 0) {
$notice['shop_title'] = app_conf("SHOP_TITLE");
$notice['url'] = "“<a href=\"" . url("index", "transfer#detail", array("id" => $v['id'])) . "\">Z-" . $v['load_id'] . "</a>”";
$notice['msg'] = "因為:“" . $msg . "”被管理員撤銷了";
$tmpl_content = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "msg_template where name = 'TPL_DEAL_SUCCESS_SITE_SMS'", false);
$GLOBALS['tmpl']->assign("notice", $notice);
$content = $GLOBALS['tmpl']->fetch("str:" . $tmpl_content['content']);
send_user_msg("", $content, 0, $transfer['user_id'], TIME_UTC, 0, true, 17);
save_log("撤銷編號:{$id的債券轉讓}", 1);
parent::success("撤銷成功!");
die;
} else {
save_log("撤銷編號:{$id的債券轉讓}", 0);
$this->error("撤銷失敗!");
die;
}
}