dever 6 years ago
parent
commit
86a80ab486
4 changed files with 22 additions and 7 deletions
  1. 4 0
      act/lib/Pay.php
  2. 10 0
      act/src/Order.php
  3. 7 7
      journal/database/info.php
  4. 1 0
      journal/src/Api.php

+ 4 - 0
act/lib/Pay.php

@@ -159,6 +159,10 @@ class Pay
                 # 积分
                 Dever::score($order['uid'], 'buy_journal', '购买小刊', '', $score, $num);
 
+                if ($order['system'] == 2) {
+                    return;
+                }
+
                 # 发消息
                 $journal['id'] = $order['product_id'];
                 $journal['name'] = $order['name'];

+ 10 - 0
act/src/Order.php

@@ -373,6 +373,16 @@ class Order extends Core
                 if ($order_info && $order_info['status'] != 2) {
                     Dever::alert('您要使用的兑换码还未支付');
                 }
+            } else {
+                # 通用兑换码 只加本数
+                if ($info['product_num'] > 0) {
+                    # 增加本数 用通用码的人不多,所以直接跨库查询吧
+                    $journal = Dever::db('journal/order')->one($journal_id);
+                    if ($journal) {
+                        $num = $journal['num_up'] + $info['product_num'];
+                        Dever::db('journal/order')->update(array('where_id' => $journal_id, 'num_up' => $num));
+                    }
+                }
             }
 
             Dever::db('code/info')->update(array('where_id' => $info['id'], 'type' => 3, 'uid' => $this->data['uid'], 'ldate' => time()));

+ 7 - 7
journal/database/info.php

@@ -230,17 +230,17 @@ $config = array
 		'num_add_view'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '阅读数基数',
+			'name' 		=> '阅读数基数-废弃',
 			'default' 	=> '0',
 			'desc' 		=> '手动增加阅读数',
 			'match' 	=> 'option',
-			'update'	=> 'text',
+			//'update'	=> 'text',
 		),
 
 		'num_view'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '阅读数',
+			'name' 		=> '阅读数-废弃',
 			'default' 	=> '0',
 			'desc' 		=> '请填写阅读数',
 			'match' 	=> 'option',
@@ -251,7 +251,7 @@ $config = array
 		'num_add_up'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '喜欢基数',
+			'name' 		=> '喜欢基数-废弃',
 			'default' 	=> '0',
 			'desc' 		=> '喜欢基数',
 			'match' 	=> 'option',
@@ -261,7 +261,7 @@ $config = array
 		'num_up'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '喜欢数',
+			'name' 		=> '喜欢数-已更新为订阅数,当使用通用兑换码时以及阅读时使用',
 			'default' 	=> '0',
 			'desc' 		=> '请填写喜欢数',
 			'match' 	=> 'option',
@@ -273,7 +273,7 @@ $config = array
 		'num_comment'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '评论数',
+			'name' 		=> '评论数-废弃',
 			'default' 	=> '0',
 			'desc' 		=> '请填写评论数',
 			'search'	=> 'order',
@@ -632,7 +632,7 @@ $config = array
 			),
 			'set' => array
 			(
-				'num_ding' => array('1', '+='),
+				'num_up' => array('1', '+='),
 			),
 		),
 

+ 1 - 0
journal/src/Api.php

@@ -30,6 +30,7 @@ class Api
                 $data['buy_num'] = $data['num_ding'];
             }
             
+            $data['num_ding'] = $data['num_ding'] + $data['num_up'];
             $data['num_ding'] = round(($data['num_ding']+$data['num_add_ding'])*$data['num_ratio_ding']);
         }