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


PHP Fn::order_status方法代码示例

本文整理汇总了PHP中Fn::order_status方法的典型用法代码示例。如果您正苦于以下问题:PHP Fn::order_status方法的具体用法?PHP Fn::order_status怎么用?PHP Fn::order_status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fn的用法示例。


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

示例1: getPayList

 static function getPayList($orderby = 'order_id', $order = 'DESC', $limit = 30, array $query_conds = array(), &$statinfo = array())
 {
     $where = "AND o.`pay_status`=2";
     if (isset($query_conds['seeall']) && $query_conds['seeall']) {
         $where = "";
     }
     $where_cond = '';
     if (isset($query_conds['target']) && $query_conds['target']) {
         if (is_numeric($query_conds['target'])) {
             $where_cond .= " AND o.`player_id`=" . $query_conds['target'];
         } else {
             $where_cond .= " AND p.`truename` like '%%" . D()->escape_string($query_conds['target']) . "%%'";
         }
     }
     if (isset($query_conds['start_date']) && $query_conds['start_date']) {
         $starttime = strtotime($query_conds['start_date'] . DAY_BEGIN);
         $where_cond .= " AND o.`add_time`>=" . $starttime;
     }
     if (isset($query_conds['end_date']) && $query_conds['end_date']) {
         $endtime = strtotime($query_conds['end_date'] . DAY_END);
         $where_cond .= " AND o.`add_time`<=" . $endtime;
     }
     $where = $where . $where_cond;
     $sql = "SELECT o.*,u.nickname,u.logo,p.truename AS player_name\n\t\t\t\t\t\t\t\tFROM `{order_info}` o INNER JOIN `{member}` u ON o.user_id=u.uid\n\t\t\t\t\t\t\t\t     INNER JOIN `{player}` p ON o.player_id=p.player_id\n\t\t\t\t       WHERE 1 {$where}\n\t\t           ORDER BY `%s` %s";
     $sqlcnt = "SELECT COUNT(o.order_id) AS rcnt FROM {order_info} o INNER JOIN `{player}` p ON o.player_id=p.player_id WHERE 1 {$where}";
     $result = D()->pager_query($sql, $limit, $sqlcnt, 0, $orderby, $order)->fetch_array_all();
     $statinfo = ['total_pay' => 0, 'current_pay' => 0];
     $statinfo['total_pay'] = D()->query("SELECT SUM(o.`goods_amount`) AS total_pay FROM `{order_info}` o INNER JOIN `{player}` p ON o.player_id=p.player_id WHERE o.`pay_status`=2 {$where_cond}")->result();
     if (empty($statinfo['total_pay'])) {
         $statinfo['total_pay'] = 0;
     }
     if (!empty($result)) {
         foreach ($result as &$it) {
             $it['order_status_name'] = Fn::order_status($it['order_status']);
             $it['pay_status_name'] = Fn::pay_status($it['pay_status']);
             if ($it['pay_status'] == PS_PAYED) {
                 $statinfo['current_pay'] += $it['goods_amount'];
             }
         }
     }
     return $result;
 }
开发者ID:GavinLai,项目名称:SimMatch,代码行数:42,代码来源:Pay_Model.php

示例2: genStatusHtml

 /**
  * 生成订单各种状态显示html
  * 
  * @param array $order
  * @return string
  */
 static function genStatusHtml(array &$order)
 {
     $html = '';
     $order['active_order'] = 0;
     //便于区分订单显示样式
     $br = '<br/>';
     if (!in_array($order['order_status'], [OS_CANCELED, OS_INVALID, OS_RETURNED])) {
         //订单“活动中”
         $order['active_order'] = 1;
         if ($order['pay_status'] == PS_UNPAYED) {
             //未支付
             $html .= '<p class="order-status-txt">' . Fn::pay_status($order['pay_status']) . '</p>';
             $html .= '<p class="order-status-op"><a href="javascript:;" class="btn btn-orange btn-order-topay" data-order_id="' . $order['order_id'] . '">立即付款</a></p>';
             $html .= '<p class="order-status-op last"><a href="javascript:;" class="btn-order-cancel" data-order_id="' . $order['order_id'] . '">取消订单</a></p>';
         } elseif ($order['pay_status'] == PS_PAYED) {
             //已支付
             $html .= '<p class="order-status-txt">' . Fn::pay_status($order['pay_status']) . $br . Fn::shipping_status($order['shipping_status']);
             if ($order['shipping_status'] == SS_RECEIVED) {
                 $html .= $br . '<span style="color:green">' . Fn::zonghe_status(CS_FINISHED) . '</span>';
                 //订单完成
                 $html .= '</p>';
                 $order['active_order'] = 0;
             } elseif ($order['shipping_status'] == SS_SHIPPED) {
                 $html .= '</p><p class="order-status-op"><a href="javascript:;" class="btn btn-orange btn-ship-confirm" data-order_id="' . $order['order_id'] . '">确认收货</a></p>';
             } else {
                 $html .= '</p>';
             }
         } else {
             //支付中
             $html .= '<p class="order-status-txt">' . Fn::order_status(OS_CONFIRMED) . $br . Fn::pay_status($order['pay_status']) . '</p>';
         }
     } else {
         $html .= '<p>' . Fn::order_status($order['order_status']) . '</p>';
     }
     return $html;
 }
开发者ID:GavinLai,项目名称:SimMatch,代码行数:42,代码来源:class.Goods.php


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