当前位置: 首页>>代码示例>>PHP>>正文


PHP send_user_msg函数代码示例

本文整理汇总了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);
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:19,代码来源:sendmsg.action.php

示例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);
 }
开发者ID:macall,项目名称:jsd,代码行数:22,代码来源:sendmsg.action.php

示例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;
     }
 }
开发者ID:workplayteam,项目名称:P2P,代码行数:38,代码来源:TransferAction.class.php

示例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']);
        }
    }
}
开发者ID:workplayteam,项目名称:P2P,代码行数:62,代码来源:manageagency.php

示例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;
}
开发者ID:eliu03,项目名称:fanweP2P,代码行数:84,代码来源:uc_func.php

示例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));
}
开发者ID:norain2050,项目名称:fanwei_xindai_3.2,代码行数:31,代码来源:app_init.php

示例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);
            }
        }
    }
}
开发者ID:norain2050,项目名称:fanwei_xindai_3.2,代码行数:25,代码来源:common.php

示例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);
 }
开发者ID:norain2050,项目名称:fanwei_xindai_3.2,代码行数:87,代码来源:msgModule.class.php

示例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;
        }
    }
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:98,代码来源:user.php

示例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);
            }
        }
    }
}
开发者ID:eliu03,项目名称:fanweP2P,代码行数:29,代码来源:common.php

示例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);
}
开发者ID:workplayteam,项目名称:P2P,代码行数:63,代码来源:deal_func.php

示例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;
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:84,代码来源:reviewModule.class.php

示例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);
     }
 }
开发者ID:eliu03,项目名称:fanweP2P,代码行数:101,代码来源:debit_dealModule.class.php

示例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);
     }
 }
开发者ID:workplayteam,项目名称:P2P,代码行数:101,代码来源:DealAction.class.php

示例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;
     }
 }
开发者ID:eliu03,项目名称:fanweP2P,代码行数:43,代码来源:TransferAction.class.php


注:本文中的send_user_msg函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。