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


PHP use_bonus函数代码示例

本文整理汇总了PHP中use_bonus函数的典型用法代码示例。如果您正苦于以下问题:PHP use_bonus函数的具体用法?PHP use_bonus怎么用?PHP use_bonus使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了use_bonus函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: done


//.........这里部分代码省略.........
	    while ($error_no == 1062); //如果是订单号重复则重新提交数据
	
	    $new_order_id = $db->insert_id();
	    $order['order_id'] = $new_order_id;
	
	    /* 插入订单商品 */
	    $sql = "INSERT INTO " . $ecs->table('order_goods') . "( " .
	                "order_id, goods_id, goods_name, goods_sn, goods_number, market_price, ".
	                "goods_price, goods_attr, is_real, extension_code, parent_id, is_gift, goods_attr_id) ".
	            " SELECT '$new_order_id', goods_id, goods_name, goods_sn, goods_number, market_price, ".
	                "goods_price, goods_attr, is_real, extension_code, parent_id, is_gift, goods_attr_id".
	            " FROM " .$ecs->table('cart') .
	            " WHERE session_id = '".SESS_ID."' AND rec_type = '$flow_type'";
	    $db->query($sql);
	    /* 修改拍卖活动状态 */
	    if ($order['extension_code']=='auction')
	    {
	        $sql = "UPDATE ". $ecs->table('goods_activity') ." SET is_finished='2' WHERE act_id=".$order['extension_id'];
	        $db->query($sql);
	    }
	
	    /* 处理余额、积分、红包 */
	    if ($order['user_id'] > 0 && $order['surplus'] > 0)
	    {
	        log_account_change($order['user_id'], $order['surplus'] * (-1), 0, 0, 0, sprintf($_LANG['pay_order'], $order['order_sn']));
	    }
	    if ($order['user_id'] > 0 && $order['integral'] > 0)
	    {
	        log_account_change($order['user_id'], 0, 0, 0, $order['integral'] * (-1), sprintf($_LANG['pay_order'], $order['order_sn']));
	    }
	
	    if ($order['bonus_id'] > 0 && $temp_amout > 0)
	    {
	        use_bonus($order['bonus_id'], $new_order_id);
	    }
	
	    /* 如果使用库存,且下订单时减库存,则减少库存 */
	    if ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_PLACE)
	    {
	        //change_order_goods_storage($order['order_id'], true, SDT_PLACE);
	    }
	error_log('1',3,'flow.log');
	    /* 给商家发邮件 */
	    /* 增加是否给客服发送邮件选项 */
	    if ($_CFG['send_service_email'] && $_CFG['service_email'] != '')
	    {
	    	error_log('2',3,'flow.log');
	        $tpl = get_mail_template('remind_of_new_order');
			/*
			$smarty->assign('order', $order);
	        $smarty->assign('goods_list', $cart_goods);
	        $smarty->assign('shop_name', $_CFG['shop_name']);
	        $smarty->assign('send_date', date($_CFG['time_format']));
	        $content = $smarty->fetch('str:' . $tpl['template_content']);
	        */
			send_mail($_CFG['shop_name'], $_CFG['service_email'], $tpl['template_subject'], $content, $tpl['is_html']);
	    }
	error_log('2',3,'flow.log');
	    /* 如果需要,发短信 */
	    if ($_CFG['sms_order_placed'] == '1' && $_CFG['sms_shop_mobile'] != '')
	    {
	        include_once(RPC_ROOT.'includes/cls_sms.php');
	        $sms = new sms();
	        $msg = $order['pay_status'] == PS_UNPAYED ?
	            $_LANG['order_placed_sms'] : $_LANG['order_placed_sms'] . '[' . $_LANG['sms_paid'] . ']';
	        $sms->send($_CFG['sms_shop_mobile'], sprintf($msg, $order['consignee'], $order['tel']), 0);
开发者ID:noikiy,项目名称:mdwp,代码行数:67,代码来源:flow.action.php

示例2: while

 } while ($error_no == 1062);
 //如果是订单号重复则重新提交数据
 $new_order_id = $db->insert_id();
 $order['order_id'] = $new_order_id;
 /* 插入订单商品 */
 $sql = "INSERT INTO " . $ecs->table('order_goods') . "( " . "order_id, goods_id, goods_name, goods_sn, product_id, goods_number, market_price, " . "goods_price, goods_attr, is_real, extension_code, parent_id, is_gift, goods_attr_id) " . " SELECT '{$new_order_id}', goods_id, goods_name, goods_sn, product_id, goods_number, market_price, " . "goods_price, goods_attr, is_real, extension_code, parent_id, is_gift, goods_attr_id" . " FROM " . $ecs->table('cart') . " WHERE session_id = '" . SESS_ID . "' AND rec_type = '{$flow_type}'";
 $db->query($sql);
 /* 处理余额、积分、抵扣券 */
 if ($order['user_id'] > 0 && $order['surplus'] > 0) {
     log_account_change($order['user_id'], $order['surplus'] * -1, 0, 0, 0, sprintf('支付订单 %s', $order['order_sn']));
 }
 if ($order['user_id'] > 0 && $order['integral'] > 0) {
     log_account_change($order['user_id'], 0, 0, 0, $order['integral'] * -1, sprintf('支付订单 %s', $order['order_sn']));
 }
 if ($order['bonus_id'] > 0 && $temp_amout > 0) {
     use_bonus($order['bonus_id'], $new_order_id);
 }
 /* 如果使用库存,且下订单时减库存,则减少库存 */
 if ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_PLACE) {
     change_order_goods_storage($order['order_id'], true, SDT_PLACE);
 }
 /* 获取用户手机号 */
 $sql = "SELECT user_id, mobile_phone FROM " . $ecs->table('users') . " WHERE user_id='{$order['user_id']}' LIMIT 1";
 $row = $db->getRow($sql);
 /* Added by Edward, 2015.09.15 */
 /* 客户下订单时给客户发送短信提醒 */
 if ($_CFG['ihuyi_sms_customer_placed'] == '1' && $row['mobile_phone'] != '') {
     require_once ROOT_PATH . 'includes/lib_sms.php';
     $smarty->assign('shop_name', $_CFG['shop_name']);
     $smarty->assign('order_sn', $order['order_sn']);
     $smarty->assign('consignee', $order['consignee']);
开发者ID:nanhuacrab,项目名称:ecshop,代码行数:31,代码来源:order.php

示例3: cps

     $sender->sendOrder();
     $ordertime = $order['add_time'] + 8 * 3600;
     $sql = "INSERT INTO cps ( " . "order_id,src,channel,cid,wi,order_time)" . " values('{$new_order_id}','emar','cps'," . $arr[2] . ",'" . $arr[3] . "','" . $ordertime . "') ";
     $db->query($sql);
 }
 /* 处理余额、积分、红包 */
 if ($order['user_id'] > 0 && $order['surplus'] > 0) {
     //log_account_change($order['user_id'], $order['surplus'] * (-1), 0, 0, 0, sprintf($_LANG['pay_order'], $order['order_sn']));
     log_mcard_change($order['user_id'], $order['surplus'] * -1, sprintf($_LANG['pay_order'], $order['order_sn']), 0, $order['order_id'], 1);
 }
 if ($order['user_id'] > 0 && $order['integral'] > 0) {
     log_account_change($order['user_id'], 0, 0, 0, $order['integral'] * -1, sprintf($_LANG['pay_order'], $order['order_sn']));
 }
 if ($order['bonus_id'] > 0 && $temp_amout > 0) {
     $reusable = $bonus['reusable'];
     use_bonus($order['bonus_id'], $new_order_id, $user_id, $reusable);
 }
 /* 如果使用库存,且下订单时减库存,则减少库存 */
 if ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_PLACE) {
     change_order_goods_storage($order['order_id'], true, SDT_PLACE);
 }
 /* 如果订单金额为0 处理虚拟卡 */
 if ($order['order_amount'] <= 0) {
     $sql = "SELECT goods_id, goods_name, goods_number AS num FROM " . $GLOBALS['ecs']->table('cart') . " WHERE is_real = 0 AND extension_code = 'virtual_card'" . " AND session_id = '" . SESS_ID . "' AND rec_type = '{$flow_type}'";
     $res = $GLOBALS['db']->getAll($sql);
     $virtual_goods = array();
     foreach ($res as $row) {
         $virtual_goods['virtual_card'][] = array('goods_id' => $row['goods_id'], 'goods_name' => $row['goods_name'], 'num' => $row['num']);
     }
     if ($virtual_goods and $flow_type != CART_GROUP_BUY_GOODS) {
         /* 虚拟卡发货 */
开发者ID:fromzyy2ann,项目名称:mescake,代码行数:31,代码来源:flow.php


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