dever 6 年之前
父節點
當前提交
5771b0ac26
共有 5 個文件被更改,包括 17 次插入4 次删除
  1. 1 1
      service/assets/mobile/success.html
  2. 10 1
      service/src/Buy.php
  3. 4 0
      service/template/mobile/success.php
  4. 1 1
      stat/lib/Journal.php
  5. 1 1
      stat/lib/Source.php

+ 1 - 1
service/assets/mobile/success.html

@@ -14,7 +14,7 @@
     <div class="success"></div>
     <p class="txt">购买成功,长按上方小程序码识别或微信搜索“<span>Jstyle精美电子刊</span>”进入小程序使用阅读码</p>
     <p class="download" style="display:none;"><a href="#">点击下载“Jstyle精美”APP查看电子刊</a></p>
-    <div style="display:none;">
+    <div id="code" style="display:none;">
         <p class="tip">(点击下方阅读码可直接复制)</p>
         <div class="read">
             <p>阅读码:1521DSJDB55</p>

+ 10 - 1
service/src/Buy.php

@@ -115,6 +115,15 @@ class Buy extends Base
         $config['list'] = $this->url('list');
         $config['buy'] = $this->url('pay', array('id' => $id));
 
+        $order_id = Dever::input('order_id');
+        $order = Dever::db('journal/order')->one($order_id);
+
+        $config['code_show'] = 'display:none;';
+        if ($order && $order['type'] == 3) {
+            $config['code_show'] = '';
+            $config['code'] = $order['code'];
+        }
+
         return $config;
     }
 
@@ -213,7 +222,7 @@ class Buy extends Base
         }
 
         //$param参数
-        $refer = $this->url('success', array('id' => $journal_id, 'buy' => $buy_id));
+        $refer = $this->url('success', array('id' => $journal_id, 'buy' => $buy_id, 'order_id' => $id));
         $param = array
         (
             'account_id' => 2,

+ 4 - 0
service/template/mobile/success.php

@@ -14,6 +14,10 @@ $view
 
 ->fetch(array('.button@href', 1), 'service/buy.success#buy')
 
+->fetch('#code@style', 'service/buy.success#code_show')
+
+->fetch('#code .read', 'service/buy.success#code')
+
 
 ->import('inc/foot')
 

+ 1 - 1
stat/lib/Journal.php

@@ -55,7 +55,7 @@ class Journal
     {
         # 这里就是为了做下sql的实现方式,其实用dever自带的功能完全可以实现。
         $day = date('Y-m-d', $where['start']);
-        $sql = 'select * from wonderful_journal_order where type = 1 and product_id = '.$info['id'].' and state = 1 and cdate >= '.$where['start'].' and cdate <= '.$where['end'];
+        $sql = 'select * from wonderful_journal_order where type in(1,3) and product_id = '.$info['id'].' and state = 1 and cdate >= '.$where['start'].' and cdate <= '.$where['end'];
         $order = Dever::db('journal/order')->fetchAll($sql);
         $order_num = $order_yes_num = $order_no_num = $buy_num = $buy_cash = 0;
         if ($order) {

+ 1 - 1
stat/lib/Source.php

@@ -58,7 +58,7 @@ class Source
     private function total($source, $info, $where, $pv, $uv, $user_num, $user_yes_num)
     {
         $day = date('Y-m-d', $where['start']);
-        $sql = 'select * from wonderful_journal_order where type = 1 and source = '.$source['id'].' and product_id = '.$info['id'].' and state = 1 and cdate >= '.$where['start'].' and cdate <= '.$where['end'];
+        $sql = 'select * from wonderful_journal_order where type in(1,3) and source = '.$source['id'].' and product_id = '.$info['id'].' and state = 1 and cdate >= '.$where['start'].' and cdate <= '.$where['end'];
         $order = Dever::db('journal/order')->fetchAll($sql);
 
         $order_num = $order_yes_num = $order_no_num = $buy_num = $buy_cash = 0;