• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_order_sn函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: pay

 public function pay()
 {
     $credit = I('get.credit', 0, 'intval');
     $json = array('error' => 0, 'message' => '', 'data' => '');
     do {
         if ($credit < 1 || $credit > 999999) {
             $user = M('user')->find($this->user_id);
             $data['body'] = "用户充值";
             $data['attach'] = "用户充值";
             $data['order_sn'] = get_order_sn('TP');
             $data['total_fee'] = $credit * 10;
             $data['time_start'] = date('YmdHis');
             $data['time_expire'] = date("YmdHis", time() + 600);
             $data['goods_tag'] = "WXG";
             // $openid = ;//session('openid')?session('openid'):cookie('openid');
             $data['openid'] = $user['openid'];
             $this->jsApiParameters = jsapipay($data, false);
             $json['data'] = json_decode($this->jsApiParameters);
             break;
         }
         #$this->error("红包状态不能支付", U('/notes'));
         $json['error'] = 1;
         $json['message'] = "红包状态不能支付";
         break;
     } while (false);
     echo json_encode($json);
     die;
 }
开发者ID:ysc8620,项目名称:zhima,代码行数:28,代码来源:TopController.class.php


示例2: createOrder

 public function createOrder($options)
 {
     //检测手机号码格式
     $chkmobile = checkmobile($options['mobile']);
     if ($chkmobile !== 0) {
         return $chkmobile;
     }
     //var_dump($options);
     $userinfo = D('Member')->certificate($options['key']);
     if (!is_array($userinfo)) {
         return $userinfo;
     }
     //20002
     $orderModel = M('51_orders');
     //填充订单数据  status - 0: 进行中,1:已结束,2:已取消, 999:已删除
     $orderdata['orderid'] = get_order_sn();
     //订单号
     $orderdata['uid'] = $userinfo['uid'];
     $orderdata['status'] = 0;
     $orderdata['options'] = array2string($options);
     print_r(string2array($orderdata['options']));
     $result = $orderModel->create($orderdata);
 }
开发者ID:kennyhonghui,项目名称:51bb,代码行数:23,代码来源:OrderModel.class.php


示例3: GetCkVdValue

 $orgCheckcode = GetCkVdValue();
 if ($checkcode != $orgCheckcode || empty($checkcode)) {
     echo 'nocheckcode';
     return;
 }
 $_SESSION['total_value'] = '';
 $tourer = Helper_Archive::getTourer($_POST);
 $needjifen = $usejifen ? Helper_Archive::getNeedJifen($jifentprice) : 0;
 $userinfo = $User->getInfoByMid($User->uid);
 //获取用户信息
 //这里再次判断用户积分是否满足条件.
 if ($userinfo['jifen'] < $needjifen) {
     $usejifen = 0;
     $needjifen = 0;
 }
 $ordersn = get_order_sn('08');
 //订单号
 $memberid = $User->uid ? $User->uid : 0;
 $row = getVisaInfo($productaid);
 $status = $paytype == 1 ? 1 : 0;
 $linktel = Helper_Archive::pregReplace($linktel, 2);
 $arr = array('ordersn' => $ordersn, 'webid' => $webid, 'typeid' => $typeid, 'productautoid' => $productautoid, 'productaid' => $row['aid'], 'productname' => $row['title'], 'price' => $row['price'], 'childprice' => 0, 'dingnum' => Helper_Archive::pregReplace($dingnum, 2), 'usedate' => $usedate, 'childnum' => 0, 'linkman' => Helper_Archive::pregReplace($linkman, 5), 'linktel' => Helper_Archive::pregReplace($linktel, 2), 'linkemail' => Helper_Archive::pregReplace($linkemail, 5), 'linkqq' => '', 'jifentprice' => $row['jifentprice'], 'jifenbook' => $row['jifenbook'], 'jifencomment' => $row['jifencomment'], 'addtime' => time(), 'memberid' => $memberid, 'dingjin' => Helper_Archive::pregReplace($dingjin, 5), 'paytype' => $paytype, 'usejifen' => $usejifen, 'needjifen' => $needjifen, 'status' => $status, 'remark' => Helper_Archive::pregReplace($remarkinfo, 5), 'tourer' => $tourer);
 if (Helper_Archive::addOrder($arr)) {
     $model = new CommonModule('#@__member_order');
     $orderid = $model->getField('id', "ordersn='{$ordersn}'");
     //判断是否开启在线支付
     if (!empty($choosepay) && $paytype != '3' && $choosepay != '6') {
         $url = $GLOBALS['cfg_basehost'] . '/visa/booking.php?dopost=payonline&id=' . $orderid . '&paytype=' . $choosepay;
     } else {
         //$url = "{$GLOBALS['cfg_basehost']}/visa/show_{$arr['productaid']}.html";
         $url = "{$GLOBALS['cfg_basehost']}/member/query.php?dopost=search&mobile={$linktel}";
开发者ID:lz1988,项目名称:stourwebcms,代码行数:31,代码来源:booking.php


示例4: isset

 $step = isset($_REQUEST['step']) && in_array($_REQUEST['step'], $step_list) ? $_REQUEST['step'] : 'user';
 /* 取得参数 order_id */
 $order_id = isset($_REQUEST['order_id']) ? intval($_REQUEST['order_id']) : 0;
 if ($order_id > 0) {
     $old_order = order_info($order_id);
 }
 /* 取得参数 step_act 添加还是编辑 */
 $step_act = isset($_REQUEST['step_act']) ? $_REQUEST['step_act'] : 'add';
 /* 插入订单信息 */
 if ('user' == $step) {
     /* 取得参数:user_id */
     $user_id = $_POST['anonymous'] == 1 ? 0 : intval($_POST['user']);
     /* 插入新订单,状态为无效 */
     $order = array('user_id' => $user_id, 'add_time' => gmtime(), 'order_status' => OS_INVALID, 'shipping_status' => SS_UNSHIPPED, 'pay_status' => PS_UNPAYED, 'from_ad' => 0, 'referer' => $_LANG['admin']);
     do {
         $order['order_sn'] = get_order_sn();
         if ($db->autoExecute($ecs->table('order_info'), $order, 'INSERT', '', 'SILENT')) {
             break;
         } else {
             if ($db->errno() != 1062) {
                 die($db->error());
             }
         }
     } while (true);
     // 防止订单号重复
     $order_id = $db->insert_id();
     /* todo 记录日志 */
     admin_log($order['order_sn'], 'add', 'order');
     /* 插入 pay_log */
     $sql = 'INSERT INTO ' . $ecs->table('pay_log') . " (order_id, order_amount, order_type, is_paid)" . " VALUES ('{$order_id}', 0, '" . PAY_ORDER . "', 0)";
     $db->query($sql);
开发者ID:norain2050,项目名称:benhu,代码行数:31,代码来源:order.php


示例5: get_order_sn

    {
        //推荐注册分成
        $parent_id = 0;
    }
    else
    {
        //分成功能关闭
        $parent_id = 0;
    }
    $order['parent_id'] = $parent_id;

    /* 插入订单表 */
    $error_no = 0;
    do
    {
        $order['order_sn'] = get_order_sn(); //获取新订单号
        $GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('order_info'), $order, 'INSERT');

        $error_no = $GLOBALS['db']->errno();

        if ($error_no > 0 && $error_no != 1062)
        {
            die($GLOBALS['db']->errorMsg());
        }
    }
    while ($error_no == 1062); //如果是订单号重复则重新提交数据

    $new_order_id = $db->insert_id();
    $order['order_id'] = $new_order_id;

    /* 插入订单商品 */
开发者ID:alphaouyang,项目名称:ecshop,代码行数:31,代码来源:flow.php


示例6: split_order

function split_order($new_order_id)
{
    $sql = "select IF(g.supplier_id, g.supplier_id,0) AS supplier_id, og.rec_id, og.goods_number, og.goods_price from " . $GLOBALS['ecs']->table("order_goods") . " AS og left join " . $GLOBALS['ecs']->table("goods") . " AS g on og.goods_id=g.goods_id " . " where og.order_id = '{$new_order_id}' ";
    $res = $GLOBALS['db']->query($sql);
    $split_orders = array();
    $all_amount = 0;
    while ($row = $GLOBALS['db']->fetchRow($res)) {
        $split_orders[$row['supplier_id']]['goods_amount'] += $row['goods_number'] * $row['goods_price'];
        $split_orders[$row['supplier_id']]['goods_reclist'][] = $row['rec_id'];
        $split_orders[$row['supplier_id']]['order_sn'] = $split_orders[$row['supplier_id']]['order_sn'] ? $split_orders[$row['supplier_id']]['order_sn'] : get_order_sn();
        $split_orders[$row['supplier_id']]['shipping_fee'] = $GLOBALS['total']['supplier_shipping'][$row['supplier_id']]['shipping_fee'];
        $split_orders[$row['supplier_id']]['order_amount'] = $split_orders[$row['supplier_id']]['goods_amount'] + $split_orders[$row['supplier_id']]['shipping_fee'];
        $split_orders[$row['supplier_id']]['order_amount_formated'] = price_format($split_orders[$row['supplier_id']]['order_amount']);
        $all_amount += $split_orders[$row['supplier_id']]['order_amount'];
    }
    //下单来源
    $order_from = WEB_FROM;
    $count_split_orders = count($split_orders);
    foreach ($split_orders as $spkey => $split) {
        //获的返佣ID
        if ($spkey > 0) {
            $sql = "select rebate_id, rebate_paytime_start, rebate_paytime_end from " . $GLOBALS['ecs']->table('supplier_rebate') . " where supplier_id='{$spkey}' and is_pay_ok=0 order by rebate_id desc limit 0,1";
            $row = $GLOBALS['db']->getRow($sql);
            $nowtime = gmtime();
            if ($nowtime >= $row['rebate_paytime_start'] && $nowtime <= $row['rebate_paytime_end']) {
                $rebate_id = $row['rebate_id'];
            } else {
                $kkk = 'yes';
                while ($kkk == 'yes') {
                    insert_id_rebate($spkey);
                    $sql2 = "select rebate_id, rebate_paytime_start, rebate_paytime_end from " . $GLOBALS['ecs']->table('supplier_rebate') . " where supplier_id='{$spkey}' and is_pay_ok=0 order by rebate_id desc limit 0,1";
                    $row2 = $GLOBALS['db']->getRow($sql2);
                    if ($nowtime >= $row2['rebate_paytime_start'] && $nowtime <= $row2['rebate_paytime_end']) {
                        $rebate_id = $row2['rebate_id'];
                        $kkk = 'no';
                    }
                }
            }
        } else {
            $rebate_id = 0;
        }
        $order_sn = $split['order_sn'];
        if ($count_split_orders == 1) {
            $sql = "update " . $GLOBALS['ecs']->table('order_info') . " set order_sn='{$order_sn}', supplier_id='{$spkey}', parent_order_id='0', rebate_id='{$rebate_id}', froms='{$order_from}'   where order_id='{$new_order_id}' ";
            $GLOBALS['db']->query($sql);
        } else {
            $sql = "insert into " . $GLOBALS['ecs']->table('order_info') . "( " . " order_sn, user_id,\torder_status,\tshipping_status, pay_status, consignee, country,\tprovince,\tcity,\tdistrict, address, zipcode, tel,\tmobile\t, email, best_time\t,sign_building,\tpostscript,\tshipping_id,\tshipping_name,\t pay_id,\tpay_name,\thow_oos, how_surplus, pack_name,\tcard_name,\tcard_message,\tinv_payee,\tinv_content, goods_amount,\tshipping_fee,\tinsure_fee,\tpay_fee,\tpack_fee,\tcard_fee, money_paid,\tsurplus,\tintegral,\tintegral_money,\tbonus,\torder_amount,\tfrom_ad,\treferer,\tadd_time,\tconfirm_time,\tpay_time,\tshipping_time,\tpack_id,\tcard_id,\tbonus_id,\tinvoice_no,\textension_code,\textension_id,\tto_buyer,\tpay_note,\tagency_id,\tinv_type,\ttax,\tis_separate,\tparent_id,\tdiscount,\t supplier_id,\tparent_order_id, rebate_id, froms, pickup_point, is_pickup) " . "select '{$order_sn}', user_id,\torder_status,\tshipping_status, pay_status, consignee, country,\tprovince,\tcity,\tdistrict, address, zipcode, tel,\tmobile\t, email, best_time\t,sign_building,\tpostscript,\tshipping_id,\tshipping_name,\t pay_id,\tpay_name,\thow_oos, how_surplus, pack_name,\tcard_name,\tcard_message,\tinv_payee,\tinv_content\t, '" . $split['goods_amount'] . "',\t'" . $split['shipping_fee'] . "',\tinsure_fee,\tpay_fee,\tpack_fee,\tcard_fee,\tmoney_paid,\tsurplus,\tintegral,\tintegral_money,\tbonus,\t'" . $split['order_amount'] . "',\tfrom_ad,\treferer,\tadd_time,\tconfirm_time,\tpay_time,\tshipping_time,\tpack_id,\tcard_id,\tbonus_id,\tinvoice_no,\textension_code,\textension_id,\tto_buyer,\tpay_note,\tagency_id,\tinv_type,\ttax,\tis_separate,\tparent_id,\tdiscount,\t'{$spkey}',\t'{$new_order_id}', '{$rebate_id}', '{$order_from}', pickup_point, is_pickup from " . $GLOBALS['ecs']->table('order_info') . " where order_id= '{$new_order_id}' ";
            $GLOBALS['db']->query($sql);
            $order_id_new = $GLOBALS['db']->insert_id();
            foreach ($split['goods_reclist'] as $rec) {
                $sql = "update " . $GLOBALS['ecs']->table('order_goods') . " set order_id='{$order_id_new}' where rec_id='{$rec}' ";
                $GLOBALS['db']->query($sql);
            }
        }
    }
    if ($count_split_orders > 1) {
        $sql = "delete from " . $GLOBALS['ecs']->table('order_info') . " where order_id='{$new_order_id}' ";
        $GLOBALS['db']->query($sql);
    }
    $arr = array();
    $arr['suborder_list'] = $split_orders;
    $arr['all_amount'] = $all_amount;
    $arr['sub_order_count'] = $count_split_orders;
    return $arr;
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:65,代码来源:lib_order.php


示例7: sendhongbao

 function sendhongbao()
 {
     header("Content-type:text/html;charset=utf-8");
     $order_list = M('zhaopian_order')->where(array('state' => 2, 'is_send_zhaopian' => 0))->select();
     foreach ($order_list as $order) {
         $hongbao_send = M('zhaopian_pay')->where(array('id' => $order['send_id']))->find();
         $hongbao_user = M('user')->find($order['zhaopian_user_id']);
         $order_user = M('user')->find($order['user_id']);
         if (!$hongbao_send) {
             //                $bao = array(
             //                    'mch_billno' =>get_order_sn(),
             //                    'send_name' => '红包照片',
             //                    're_openid' =>$order['zhaopian_openid'],
             //                    'total_amount' => floor($order['amount'] * 0.98 * 100),
             //                    'wishing' => '恭喜您!你发布的照片有朋友购买了。',
             //                    'act_name'=> '红包照片',
             //                    'remark' => '红包照片',
             //                );
             $bao = array('partner_trade_no' => get_order_sn(), 're_user_name' => $hongbao_user['name'], 'openid' => $order['zhaopian_openid'], 'amount' => floor($order['amount'] * 0.98 * 100), 'desc' => "好消息!“{$order_user['name']}”刚刚购买了您的私货照片。");
             $send = $bao;
             $send['user_id'] = $order['zhaopian_user_id'];
             $send['addtime'] = time();
             $send['order_id'] = $order['id'];
             $send['zhaopian_id'] = $order['zhaopian_id'];
             $hongbao_id = M('zhaopian_pay')->add($send);
             if ($hongbao_id) {
                 M('zhaopian_order')->where(array("id='{$order['id']}'"))->save(array('send_id' => $hongbao_id, 'send_sn' => $bao['partner_trade_no'], 'send_time' => time()));
                 $hongbao_send = M('zhaopian_pay')->find($hongbao_id);
             }
         }
         // 发送红包
         if ($hongbao_send) {
             if ($hongbao_send['state'] == 2) {
                 continue;
             }
             //                $bao = array(
             //                    'mch_billno' =>$hongbao_send['mch_billno'],
             //                    'send_name' => '红包照片',
             //                    're_openid' =>$order['zhaopian_openid'],
             //                    'total_amount' => floor($order['amount'] * 0.98 * 100),
             //                    'wishing' => '恭喜您!你发布的照片有朋友购买了。',
             //                    'act_name'=> '红包照片',
             //                    'remark' => '红包照片',
             //                );
             $bao = array('partner_trade_no' => $hongbao_send['partner_trade_no'], 're_user_name' => $hongbao_send['re_user_name'], 'openid' => $order['zhaopian_openid'], 'amount' => floor($order['amount'] * 0.98 * 100), 'desc' => "好消息!“{$order_user['name']}”刚刚购买了您的私货照片。");
             $data = sendPay($bao);
             if ($data['result_code'] == 'SUCCESS' && $data['return_code'] == 'SUCCESS') {
                 M('zhaopian_order')->where(array("id='{$order['id']}'"))->save(array('is_send_zhaopian' => 1));
                 M('zhaopian_pay')->where(array("id='{$hongbao_send['id']}'"))->save(array('state' => 2, 'payment_no' => $data['payment_no']));
                 $log = "发送红包成功, 红包编号:{$order['id']},发送编号:{$hongbao_send['id']}";
                 f_log($log, ROOT_PATH . 'Runtime/Logs/zhaopian.log');
                 echo $log . "<br/>";
             } else {
                 echo "amount:" . $order['amount'];
                 print_r($data);
                 $log = "发送红包失败, 红包编号:{$order['id']},发送编号:{$hongbao_send['id']}";
                 f_log($log, ROOT_PATH . 'Runtime/Logs/zhaopian.log');
                 echo $log . "<br/>";
             }
             sleep(5);
         }
     }
     die('ok');
 }
开发者ID:ysc8620,项目名称:zhima,代码行数:64,代码来源:AutoController.class.php


示例8: Queryorder

 public function Queryorder($transaction_id)
 {
     $input = new WxPayOrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = WxPayApi::orderQuery($input);
     Log::DEBUG("query:" . json_encode($result));
     if (array_key_exists("return_code", $result) && array_key_exists("result_code", $result) && $result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS") {
         f_log(http_build_query($result), dirname(__FILE__) . '/wzlog.log');
         $result['addtime'] = time();
         $id = M('pay_log')->add($result);
         // 更改order 状态
         // 更改 hongbao状态
         $result['out_trade_no'];
         $order = M('zhaopian_order')->where("order_sn='{$result['out_trade_no']}'")->find();
         $user = M('user')->find($order['user_id']);
         if ($order) {
             // 重复操作
             if ($order['state'] > 1) {
                 return true;
             }
             $order_data = array('pay_id' => $id, 'pay_time' => time(), 'transaction_id' => $result['transaction_id'], 'state' => 2);
             M('zhaopian_order')->where("id='{$order['id']}'")->save($order_data);
             $zhaopian = M('zhaopian')->where("id='{$order['hongbao_id']}'")->find();
             if ($zhaopian) {
                 $data = array('update_time' => time(), 'total_num' => $zhaopian['total_num'] + 1, 'total_amount' => $zhaopian['total_amount'] + $order['amount']);
                 // 自动发送红包
                 if (true) {
                     $bao = array('mch_billno' => get_order_sn('wz'), 'send_name' => '红包照片', 're_openid' => $zhaopian['openid'], 'total_amount' => floor($order['amount'] * 0.98 * 100), 'wishing' => '恭喜您!您在照片刚刚"' . $user['name'] . '"购买了', 'act_name' => '红包照片', 'remark' => '红包照片');
                     $send = $bao;
                     $send['user_id'] = $zhaopian['user_id'];
                     $send['addtime'] = time();
                     $hongbao_id = M('zhaopian_send')->add($send);
                     if ($hongbao_id) {
                         M('zhaopian_order')->where(array("id='{$order['id']}'"))->save(array('send_id' => $hongbao_id, 'send_sn' => $bao['mch_billno'], 'send_time' => time()));
                         $data = sendHongBao($bao);
                         if ($data['result_code'] == 'SUCCESS' && $data['return_code'] == 'SUCCESS') {
                             M('zhaopian_order')->where(array("id='{$order['id']}'"))->save(array('is_send_zhaopian' => 1));
                             M('zhaopian_send')->where(array("id='{$hongbao_id}'"))->save(array('state' => 2, 'send_listid' => $data['send_listid']));
                             $user_amount = number_format($order['amount'] * 0.98, 2);
                             $msg = "你发布的照片有朋友购买了!\n\n照片标题:{$zhaopian['remark']}\n\n支付金额:¥{$order['amount']}元\n\n好友购买照片钱已经通过微信红包打给你,其中已扣除2%微信支付手续费,扣除后金额为{$user_amount}元";
                             \Wechat\Wxapi::send_wxmsg($zhaopian['openid'], '红包照片状态提醒', U('/zhao/zhaopian/detail', array('id' => $zhaopian['number_no']), true, true), $msg);
                         } else {
                             M('hongbao_send')->where(array("id='{$hongbao_id}'"))->save(array('state' => 3));
                             $user_amount = number_format($order['amount'] * 0.98, 2);
                             $msg = "你发布的照片有朋友购买了!\n\n照片标题:{$zhaopian['remark']}\n\n支付金额:¥{$order['amount']}元\n\n红包将会在1~3个工作内,通过微信红包打给你,\n其中已扣除2%的微信支付手续费,扣除后金额为{$user_amount}元。\n因为微信支付到我们的账户需要1~3个工作日,我们\n的账户预存垫付的现金不足,暂时不能实时转账,希望\n理解。资金安全请你放心,如果有疑问请联系客服。";
                             \Wechat\Wxapi::send_wxmsg($zhaopian['openid'], '红包照片状态提醒', U('/zhao/zhaopian/detail', array('id' => $zhaopian['number_no']), true, true), $msg);
                             $sys_openid = "obb1AuA79tIJ-BGY7HA38FXAJwoc";
                             $msg = "重要提示! 红包发送异常!!! 可能余额不足,或支付金额异常,支付金额:{$user_amount},请及时处理.";
                             \Wechat\Wxapi::send_wxmsg($sys_openid, '红包照片状态提醒', "http://{$_SERVER['HTTP_HOST']}", $msg);
                         }
                     }
                 }
             }
         }
         return true;
     }
     return false;
 }
开发者ID:ysc8620,项目名称:zhima,代码行数:58,代码来源:weizhao.php


示例9: explode

 }
 $udate = explode("|", $udate);
 $dnum = explode("|", $dnum);
 $dprice = explode('|', $dprice);
 $memberid = $User->uid ? $User->uid : 0;
 $status = $paytype == 1 ? 1 : 0;
 //$roominfo = getRoomInfo($suitid);
 $ordersn = get_order_sn('02');
 $linktel = Helper_Archive::pregReplace($linktel, 2);
 $arr = array('ordersn' => $ordersn, 'webid' => 0, 'typeid' => $typeid, 'productautoid' => $productautoid, 'productaid' => $productaid, 'productname' => $productname, 'childprice' => 0, 'childnum' => $childnum, 'linkman' => Helper_Archive::pregReplace($linkman, 5), 'linktel' => Helper_Archive::pregReplace($linktel, 2), 'linkemail' => Helper_Archive::pregReplace($linkemail, 5), 'linkqq' => '', 'jifentprice' => $jifentprice, 'jifenbook' => $jifenbook, 'jifencomment' => $jifencomment, 'addtime' => time(), 'memberid' => $memberid, 'dingjin' => Helper_Archive::pregReplace($dingjin, 2), 'suitid' => $suitid, 'paytype' => $paytype, 'status' => $status, 'haschild' => 1, 'remark' => Helper_Archive::pregReplace($remarkinfo, 5));
 $mainid = Helper_Archive::addOrder($arr, 0);
 //主定单id
 $num = $dnum[0];
 $j = 0;
 for ($i = 0; isset($udate[$i]); $i++) {
     $ordersn = get_order_sn('02');
     //订单号
     $store_num = getCurrentStore($udate[$i], $suitid);
     if (intval($dnum[$i]) <= $store_num || $store_num == -1) {
         $arr['dingnum'] = $dnum[$i];
         //$arr['price'] = $dprice[$i];
         $arr['price'] = getActualPrice($suitid, $udate[$i]);
         $arr['usedate'] = $udate[$i];
         $arr['ordersn'] = $ordersn;
         if ($i == 0 && !empty($usejifen)) {
             $arr['usejifen'] = $usejifen;
             $arr['needjifen'] = $needjifen;
         } else {
             $arr['usejifen'] = 0;
             $arr['needjifen'] = 0;
         }
开发者ID:lz1988,项目名称:stourwebcms,代码行数:31,代码来源:booking.php


示例10: done_receive


//.........这里部分代码省略.........
     /* 配送方式 */
     $order['shipping_fee'] = $total['shipping_fee'];
     $order['insure_fee'] = $total['shipping_insure'];
     /* 支付方式 */
     $order['pay_fee'] = $total['pay_fee'];
     $order['cod_fee'] = $total['cod_fee'];
     $order['order_amount'] = number_format($total['amount'], 2, '.', '');
     $order['order_amount'] = 0;
     /* 如果订单金额为0(使用余额或积分或红包支付),修改订单状态为已确认、已付款 */
     if ($order['order_amount'] <= 0) {
         $order['order_status'] = OS_CONFIRMED;
         $order['confirm_time'] = gmtime();
         $order['pay_status'] = PS_PAYED;
         $order['pay_time'] = gmtime();
         $order['order_amount'] = 0;
     }
     $order['integral_money'] = $total['integral_money'];
     $order['integral'] = $total['integral'];
     if ($order['extension_code'] == 'exchange_goods') {
         $order['integral_money'] = 0;
         $order['integral'] = $total['exchange_integral'];
     }
     $order['from_ad'] = !empty($_SESSION['from_ad']) ? $_SESSION['from_ad'] : '0';
     $order['referer'] = !empty($_SESSION['referer']) ? addslashes($_SESSION['referer']) : '';
     /* 记录扩展信息 */
     if ($flow_type != CART_GENERAL_GOODS) {
         $order['extension_code'] = $_SESSION['extension_code'];
         $order['extension_id'] = $_SESSION['extension_id'];
     }
     $order['parent_id'] = 0;
     /* 插入订单表 */
     $error_no = 0;
     do {
         $order['order_sn'] = get_order_sn();
         // 获取新订单号
         $new_order = model('Common')->filter_field('order_info', $order);
         $this->model->table('order_info')->data($new_order)->insert();
         $error_no = M()->errno();
         if ($error_no > 0 && $error_no != 1062) {
             die(M()->errorMsg());
         }
     } while ($error_no == 1062);
     // 如果是订单号重复则重新提交数据
     $new_order_id = M()->insert_id();
     $order['order_id'] = $new_order_id;
     /* 插入订单商品 */
     $sql = "INSERT INTO " . $this->model->pre . "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 " . $this->model->pre . "cart WHERE session_id = '" . SESS_ID . "' AND rec_type = '{$flow_type}'";
     $this->model->query($sql);
     /* 如果使用库存,且下订单时减库存,则减少库存 */
     if (C('use_storage') == '1' && C('stock_dec_time') == SDT_PLACE) {
         model('Order')->change_order_goods_storage($order['order_id'], true, SDT_PLACE);
     }
     /* 减少礼包中的商品数 */
     if ($cart_goods[0]['goods_number']) {
         model('Order')->change_gift_storage($sn_id, $cart_goods[0]['goods_number']);
     }
     /* 插入日志 */
     $Gift = $this->model->table('gift_sn')->where("sn_id='" . $sn_id . "'")->find();
     if ($Gift['type'] == 1) {
         $data_l['type'] = 3;
     }
     $data_l['type'] = 2;
     $data_l['sn_id'] = $sn_id;
     $data_l['sn'] = $Gift['sn'];
     $data_l['create_user_id'] = $Gift['user_id'];
     $data_l['receive_user_id'] = $_SESSION['user_id'];
开发者ID:noikiy,项目名称:shop-3,代码行数:67,代码来源:ReceiveController.class.php


示例11: db_create_in

        $goodslist = $db->getAll("select g.goods_name,g.shop_price,g.goods_sn,g.goods_id from " . $ecs->table("goods") . "  g where g.goods_id " . db_create_in($goodsid) . " ");
        $ngoodslist = array();
        $gnums = unserialize($taocan['gnums']);
        foreach ($goodslist as $n) {
            foreach ($goodsid as $j => $id) {
                if ($n['goods_id'] == $id) {
                    $n['goods_num'] = $gnums[$j];
                    $ngoodslist[] = $n;
                }
            }
        }
        $totalprice = 0;
        foreach ($goodslist as $g) {
            $totalprice += $g['shop_price'];
        }
        $order = array('order_sn' => get_order_sn(), 'user_id' => $taocan['user_id'], 'shipping_name' => '黑猫宅急便', 'shipping_id' => 2, 'order_status' => OS_CONFIRMED, 'shipping_status' => SS_UNSHIPPED, 'pay_status' => PS_PAYED, 'consignee' => $taocan['consignee'], 'country' => $taocan['country'], 'province' => $taocan['province'], 'city' => $taocan['city'], 'district' => $taocan['district'], 'address' => $taocan['address'], 'zipcode' => $taocan['zipcode'], 'tel' => '', 'mobile' => $taocan['mobile'], 'email' => $taocan['email'], 'best_time' => local_date('Y-m-d', gmstr2time("1 day")) . " " . $taocan['halfday'], 'sign_building' => '', 'email' => $taocan['email'], 'pay_id' => '4', 'pay_name' => '余额支付', 'goods_amount' => $totalprice, 'money_paid' => $ordertotalprice, 'order_amount' => $ordertotalprice, 'referer' => '用户套餐自动生成', 'add_time' => gmtime(), 'confirm_time' => gmtime(), 'pay_time' => gmtime(), 'shipping_time' => gmtime(), 'discount' => $totalprice - $ordertotalprice);
        // Add by Edward
        //fwrite($james,"订单号:".get_order_sn()."--用户ID:".$taocan['user_id']."——收货人:".$taocan['consignee']."\n");
        $GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('order_info'), $order, 'INSERT');
        $new_order_id = $db->insert_id();
        foreach ($ngoodslist as $goods) {
            $ogoods = array('order_id' => $new_order_id, 'goods_id' => $goods['goods_id'], 'goods_name' => $goods['goods_name'], 'goods_sn' => $goods['goods_sn'], 'product_id' => '0', 'goods_number' => $goods['goods_num'], 'goods_price' => $goods['shop_price'], 'goods_attr' => '', 'send_number' => '0', 'is_real' => '1', 'extension_code' => '', 'parent_id' => '', 'is_gift' => '0', 'goods_attr_id' => '');
            $GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('order_goods'), $ogoods, 'INSERT');
        }
        //添加日志
        order_action($order['order_sn'], OS_CONFIRMED, SS_UNSHIPPED, PS_PAYED, '', '套餐自动生成订单');
        log_account_change($order['user_id'], -$ordertotalprice, 0, 0, 0, '用户套餐自动生成订单:' . $order['order_sn'] . ',自动扣除', ACT_OTHER);
        $db->query("update " . $ecs->table("user_tc_goods") . " set weeks = " . $weeks . " where id=" . $taocan['tid']);
    }
    $db->query("update " . $ecs->table("taocan_job") . " set last_date='" . gmtime() . "', weeks = " . $weeks . "");
}
开发者ID:nanhuacrab,项目名称:ecshop,代码行数:31,代码来源:taocanjob.php


示例12: order

 public function order()
 {
     // $sign = I('post.sign');
     $id = I('post.id', '', 'strval');
     $json = array('error' => 0, 'message' => '', 'data' => '');
     do {
         $hongbao = M('hongbao')->where(array('number_no' => $id))->find();
         if (!$hongbao) {
             // $this->error('没找到红包详情', U('/notes'));
             $json['error'] = 1;
             $json['message'] = '没找到红包详情';
             break;
         }
         //            if($sign != session('sign')){
         //                $this->error('请不要重复提交.',U('/hongbao/buy',array('id'=>$id)));
         //            }else{
         //                session('sign', microtime(true));
         //            }
         $total = I('post.num', 0, 'intval');
         // $total_amount = intval(M('hongbao_order')->where(array("number_no"=>$id, "state"=>1))->sum('total_amount'));
         $total_num = M('hongbao_order')->where(array("hongbao_id" => $hongbao['id'], "state" => 1, "addtime" => array('gt', time() - 30)))->sum('part_num');
         $total_num = intval($total_num);
         if ($total < 1 || $total + $hongbao['total_num'] + $total_num > $hongbao['total_part']) {
             //                $this->error('你已超过红包份额限制,请重新设置份额.',U('/hongbao/buy',array('id'=>$id)));
             //                return false;
             $json['error'] = 2;
             $json['message'] = '被人抢先一步了。由于有人在您之前支付,剩余的份数小于您想要购买的份数了,请重新确认参与份数.';
             break;
         }
         $user = M('user')->find($this->user_id);
         //            $hongbao_order = M('hongbao_order')->where(array('user_id'=>$this->user_id, 'state'=>1, 'hongbao_id'=>$hongbao['id']))->find();
         //            if($hongbao_order){
         //                $data = array(
         //                    'addtime' => time(),
         //                    'part_num' => $total,
         //                    'total_amount'=>$hongbao['part_amount'] * $total
         //                );
         //                $rs = M('hongbao_order')->where(array('id'=>$hongbao_order['id']))->save($data);
         //                if($rs){
         //                    $json['data'] = $hongbao_order['order_sn'];
         //                    break;
         //                }else{
         //                    $json['error'] = 1;
         //                    $json['message'] = '操作失败,请重试.';
         //                }
         //            }
         $data = array('hongbao_id' => $hongbao['id'], 'hongbao_user_id' => $hongbao['user_id'], 'number_no' => $hongbao['number_no'], 'order_sn' => get_order_sn(), 'user_id' => $this->user_id, 'part_num' => $total, 'part_amount' => $hongbao['part_amount'], 'total_amount' => $hongbao['part_amount'] * $total, 'addtime' => time(), 'state' => 1, 'openid' => $user['openid']);
         $rs = M('hongbao_order')->add($data);
         if ($rs) {
             //                redirect(U('/weixin/pay', array('id'=>$data['order_sn'])));
             //                // $this->success('操作成功.',U('/hongbao/detail',array('id'=>$id)));
             //                return true;
             $json['data'] = $data['order_sn'];
             break;
         } else {
             //                $this->error('操作失败,请重试.',U('/hongbao/buy',array('id'=>$id)));
             //                return false;
             $json['error'] = 1;
             $json['message'] = '操作失败,请重试.';
             break;
         }
     } while (false);
     echo json_encode($json);
 }
开发者ID:ysc8620,项目名称:zhima,代码行数:64,代码来源:HongbaoController.class.php


示例13: order

 public function order()
 {
     // $sign = I('post.sign');
     $id = I('post.id', '', 'strval');
     $json = array('error' => 0, 'message' => '', 'data' => '');
     do {
         $zhaopian = M('zhaopian')->where(array('number_no' => $id))->find();
         if (!$zhaopian) {
             // $this->error('没找到红包详情', U('/notes'));
             $json['error'] = 1;
             $json['message'] = '没找到红包照片详情';
             break;
         }
         $amount = I('post.amount', 0, 'floatval');
         if ($amount > $zhaopian['max_amount'] || $amount < $zhaopian['min_amount']) {
             $json['error'] = 1;
             $json['message'] = '红包金额不在有效范围内.有效范围' . $zhaopian['min_amount'] . '-' . $zhaopian['max_amount'] . '之间.';
             break;
         }
         $zhaopian_order = M('zhaopian_order')->where(array('zhaopian_id' => $zhaopian['id'], 'user_id' => $this->user_id, 'state' => 2))->find();
         if ($zhaopian_order) {
             $json['error'] = 1;
             $json['message'] = '你已经购买过该照片,请刷新后访问该照片.';
             break;
         }
         $user = M('user')->find($this->user_id);
         $data = array('zhaopian_id' => $zhaopian['id'], 'zhaopian_user_id' => $zhaopian['user_id'], 'zhaopian_openid' => $zhaopian['openid'], 'number_no' => $zhaopian['number_no'], 'order_sn' => get_order_sn('zo'), 'user_id' => $this->user_id, 'amount' => $amount, 'addtime' => time(), 'state' => 1, 'openid' => $user['openid']);
         $rs = M('zhaopian_order')->add($data);
         if ($rs) {
             $json['data'] = $data['order_sn'];
             break;
         } else {
             $json['error'] = 1;
             $json['message'] = '操作失败,请重试.';
             break;
         }
     } while (false);
     echo json_encode($json);
 }
开发者ID:ysc8620,项目名称:zhima,代码行数:39,代码来源:ZhaopianController.class.php


示例14: createOrder

function createOrder($gid, $t, $nick)
{
    $order = array();
    $order['add_time'] = $t - 7 * 86400;
    //购买时间直接倒数7天
    $order['order_status'] = OS_CONFIRMED;
    $order['confirm_time'] = $t - 7 * 86400;
    $order['pay_status'] = PS_PAYED;
    $order['pay_time'] = $t - 7 * 86400;
    $order['shipping_status'] = 2;
    $order['order_amount'] = 0;
    $order['order_sn'] = get_order_sn();
    //获取新订单号
    $order['tb_nick'] = $nick;
    $GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('order_info'), $order, 'INSERT');
    $new_order_id = $GLOBALS['db']->insert_id();
    $goods = $GLOBALS['db']->getRow("select * from " . $GLOBALS['ecs']->table('goods') . " where goods_id={$gid}");
    $sql = "INSERT INTO " . $GLOBALS['ecs']->table('order_goods') . "( " . "order_id, goods_id, goods_name, goods_sn, goods_number, market_price,\r\n\t\tgoods_price, goods_attr, is_real, extension_code, parent_id, is_gift, goods_attr_id) value " . "({$new_order_id},{$gid},'{$goods['goods_name']}','{$goods['goods_sn']}',1,0,0,'',0,'',0,0,0)";
    $GLOBALS['db']->query($sql);
    return true;
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:21,代码来源:getTaoBaoGoods.php


示例15: showMsg

 //获取用户信息
 //这里再次判断用户积分是否满足条件.
 if ($userinfo['jifen'] < $needjifen) {
     $usejifen = 0;
     $needjifen = 0;
 }
 if (empty($suitid)) {
     showMsg("请选择套餐", -1, 3);
     exit;
 }
 $row = $dsql->getOne("select a.*,b.aid,b.title from #@__car_suit a inner join #@__car b on a.carid=b.id  where a.id={$suitid}");
 if (empty($row)) {
     showMsg("定购错误,请重试", -1, 3);
     exit;
 }
 $ordersn = get_order_sn('03');
 //订单号
 $memberid = $User->uid ? $User->uid : 0;
 $status = $paytype == 1 ? 1 : 0;
 $price = getSuitPriceByDay($suitid, $usedate);
 $total_store = getSuitNumberByDay($suitid, $usedate);
 $total_dingnum = intval(Helper_Archive::pregReplace($dingnum, 2));
 if ($total_store != -1 && $total_store < $total_dingnum) {
     echo 'nonumber';
     exit;
 }
 $linktel = Helper_Archive::pregReplace($linktel, 2);
 $arr = array('ordersn' => $ordersn, 'webid' => 0, 'typeid' => 3, 'productautoid' => $row['carid'], 'productaid' => $row['aid'], 'productname' => $row['title'] . '(' . $row['suitname'] . ')', 'price' => $price, 'usedate' => $usedate, 'dingnum' => Helper_Archive::pregReplace($dingnum, 2), 'linkman' => Helper_Archive::pregReplace($linkman, 5), 'linktel' => Helper_Archive::pregReplace($linktel, 2), 'linkemail' => Helper_Archive::pregReplace($linkemail, 5), 'linkqq' => '', 'jifentprice' => $row['jifentprice'], 'jifenbook' => $row['jifenbook'], 'jifencomment' => $row['jifencomment'], 'addtime' => time(), 'memberid' => $memberid, 'dingjin' => $row['dingjin'], 'paytype' => $paytype, 'usejifen' => $usejifen, 'needjifen' => $needjifen, 'status' => $status, 'haschild' => 0, 'pid' => 0, 'remark' => Helper_Archive::pregReplace($remarkinfo, 5));
 $price = $arr['price'];
 $remark = $arr['remark'];
 if (Helper_Archive::addOrder($arr)) {
开发者ID:lz1988,项目名称:stourwebcms,代码行数:31,代码来源:booking.php


示例16: Queryorder

 public function Queryorder($transaction_id)
 {
     $input = new WxPayOrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = WxPayApi::orderQuery($input);
     Log::DEBUG("query:" . json_encode($result));
     if (array_key_exists("return_code", $result) && array_key_exists("result_code", $result) && $result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS") {
         f_log(http_build_query($result), dirname(__FILE__) . '/mylog.log');
         $result['addtime'] = time();
         $id = M('pay_log')->add($result);
         // 更改order 状态
         // 更改 hongbao状态
         $order_sn = $result['out_trade_no'];
         if (substr($order_sn, 0, 2) == 'HB') {
             $this->bao($result, $id);
             return true;
         }
         if (substr($order_sn, 0, 2) == 'ZP') {
             $this->zhaopian($result, $id);
             return true;
         }
         $order = M('hongbao_order')->where("order_sn='{$result['out_trade_no']}'")->find();
         if ($order) {
             // 重复操作
             if ($order['state'] > 1) {
                 return true;
             }
             $order_data = array('pay_id' => $id, 'pay_time' => time(), 'transaction_id' => $result['transaction_id'], 'state' => 2);
             M('hongbao_order')->where("id='{$order['id']}'")->save($order_data);
             $hongbao = M('hongbao')->where("id='{$order['hongbao_id']}'")->find();
             if ($hongbao) {
                 $data = array('update_time' => time(), 'total_num' => $hongbao['total_num'] + $order['part_num'], 'total_pay_amount' => $hongbao['total_pay_amount'] + $order['total_amount'], 'total_user' => $hongbao['total_user'] + 1);
                 if ($data['total_num'] >= $hongbao['total_part'] || $data['total_pay_amount'] >= $hongbao['total_amount']) {
                     $data['state'] = 2;
                     $data['success_time'] = time();
                 }
                 M('hongbao')->where("id='{$order['hongbao_id' 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_os函数代码示例发布时间:2022-05-15
下一篇:
PHP get_order_info函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap