<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ## 示例代碼 ``` <?php /** * +---------------------------------------------------------------------- * | 草帽支付系統 [ WE CAN DO IT JUST THINK ] * +---------------------------------------------------------------------- * | Copyright (c) 2018 http://www.iredcap.cn All rights reserved. * +---------------------------------------------------------------------- * | Licensed ( https://www.apache.org/licenses/LICENSE-2.0 ) * +---------------------------------------------------------------------- * | Author: Brian Waring <BrianWaring98@gmail.com> * +---------------------------------------------------------------------- */ namespace app\common\logic; use app\common\library\exception\OrderException; use think\Db; use think\Log; class Orders extends BaseLogic { /** * * 獲取訂單列表 * * @author 勇敢的小笨羊 * @param array $where * @param bool $field * @param string $order * @param int $paginate * @return mixed */ public function getOrderList($where = [], $field = true, $order = 'create_time desc', $paginate = 15) { $this->modelOrders->limit = !$paginate; return $this->modelOrders->getList($where, $field, $order, $paginate); } /** * 獲取單總數 * * @author 勇敢的小笨羊 <brianwaring98@gmail.com> * * @param $where * @return mixed */ public function getOrdersCount($where = []){ return $this->modelOrders->getCount($where); } /** * * 獲取結算訂單列表 * * @author 勇敢的小笨羊 * @param array $where * @param bool $field * @param string $order * @param int $paginate * @return mixed */ public function getOrderSettleList($where = [], $field = true, $order = 'create_time desc', $paginate = 15) { return $this->modelBalanceSettle->getList($where, $field, $order, $paginate); } /** * 訂單統計 * * @author 勇敢的小笨羊 <brianwaring98@gmail.com> * * @return array */ public function getOrdersAllStat(){ $order = 'create_time desc'; return [ 'fees' => $this->modelOrders->getInfo([],"sum(amount) as total,sum(if(status=2,amount,0)) as paid", $order, $paginate = false) ]; } /** * 獲取控制臺統計 * * @author 勇敢的小笨羊 <brianwaring98@gmail.com> * * @return array */ public function getWelcomeStat(){ $order = 'create_time desc'; return [ 'order' => $this->modelOrders->getInfo([],"count(id) as total,count(if(status=2,true,null)) as success,count(if(status=1,true,null)) as wait,count(if(status=0,true,null)) as failed,sum(amount) as fees,sum(if(status=1,amount,0)) as unpaid,sum(if(status=2,amount,0)) as paid", $order, $paginate = false), 'user' => $this->modelUser->getInfo([],"count(uid) as total,count(if(is_verify=0,true,null)) as failed", $order, $paginate = false), 'cash' => $this->modelBalanceCash->getInfo([],'count(id) as total,count(if(status=1,true,null)) as success,count(if(status=0,true,null)) as failed', $order, $paginate = false) ]; } /** * 年月訂單以及交易額統計 * * @author 勇敢的小笨羊 <brianwaring98@gmail.com> * */ public function getOrdersMonthStat(){ $this->modelOrders->group = 'month'; return $this->modelOrders->getList([],"count(id) as total_orders,sum(`amount`) as total_amount,FROM_UNIXTIME(create_time,'%m') as month",false,false); } /** * 獲取商戶訂單統計 * * @author 勇敢的小笨羊 <brianwaring98@gmail.com> * * @param array $where * @param string $field * @param string $order * @param int $paginate * @return mixed */ public function getOrderUserStat($where = [],$field = "uid,count(uid) as total_orders,sum(amount) as total_fee_all,sum(if(status=1,amount,0)) as total_fee_dis,sum(if(status=2,amount,0)) as total_fee_paid",$order = 'create_time desc', $paginate = 15){ $this->modelOrders->group = 'uid'; return $this->modelOrders->getList($where,$field, $order, $paginate = false); } /** * 獲取渠道訂單統計 * * @author 勇敢的小笨羊 <brianwaring98@gmail.com> * * @param array $where * @param string $field * @param string $order * @param int $paginate * @return mixed */ public function getOrderChannelStat($where = [],$field = "a.cnl_id,count(a.cnl_id) as total_orders,sum(a.amount) as total_fee_all,sum(if(a.status = 1,a.amount,0)) as total_fee_dis,sum(if(a.status = 2,a.amount,0)) as total_fee_paid,b.id,b.name,b.remarks,b.daily,b.rate",$order = 'a.create_time desc', $paginate = 15){ $this->modelOrders->group = 'a.cnl_id'; $this->modelOrders->alias('a'); $join = [ ['pay_channel b', ' b.id = a.cnl_id'], ]; $this->modelOrders->join = $join; return $this->modelOrders->getList($where,$field, $order, $paginate = false); } /** * 獲取某訂單支付通道配置 * * @author 勇敢的小笨羊 <brianwaring98@gmail.com> * * @param $order_no * @return mixed */ public function getOrderPayConfig($order_no){ return $this->logicPay->getChannelParam( $this->modelOrders->getValue( ['trade_no'=>$order_no], 'cnl_id' ) )[1]; } /** * 設置某個字段參數 * * @author 勇敢的小笨羊 <brianwaring98@gmail.com> * * @param array $where * @param string $value */ public function setValue($where = [],$value = ''){ $this->modelOrders->setFieldValue($where, 'cnl_id', $value); } } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看