dever 6 years ago
parent
commit
493b53b5ce

+ 1 - 1
code/database/info.php

@@ -125,7 +125,7 @@ return array
 		'score'         => array
         (
             'type'      => 'varchar-80',
-            'name'      => '增加积分数-直接填写积分数,设置之后,积分规则里的设置及小刊兑换码中的设置将失效',
+            'name'      => '增加积分数-直接填写积分数,设置之后,积分规则里的设置及小刊兑换码中的设置将失效,当设置为0时,直接使用积分规则中的设置。当设置为-1时,不增加积分数',
             'default'   => '',
             'desc'      => '增加积分数',
             'match'     => 'is_string',

+ 1 - 1
journal/database/cate.php

@@ -9,7 +9,7 @@ $type = array
     1 => '全屏图',
     
     # 2019-03-27 增加两个类型
-    7 => '长图',
+    7 => '长图(文字)',
     8 => '横屏图',
 
     2 => '长图',

+ 1 - 1
journal/database/content.php

@@ -14,7 +14,7 @@ $type_config = array
     1 => '全屏图',
     
     # 2019-03-27 增加两个类型
-    7 => '长图',
+    7 => '长图(文字)',
     8 => '横屏图',
 
     2 => '长图',

+ 12 - 0
journal/database/order.php

@@ -5,6 +5,7 @@ $type = array
     1 => '购买小刊',
     2 => '兑换小刊',
     3 => '购买兑换码',
+    4 => '使用通用兑换码',
 );
 
 # 系统
@@ -200,6 +201,17 @@ return array
             //'list'        => true,
         ),
 
+        'buy_num'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '购买本数',
+            'default'   => '',
+            'desc'      => '购买本数',
+            'match'     => 'is_numeric',
+            //'search'    => 'select',
+            //'list'        => true,
+        ),
+
         'type'      => array
         (
             'type'      => 'int-11',

File diff suppressed because it is too large
+ 0 - 0
main/assets/mobile/css/feature.css


+ 1 - 1
main/assets/mobile/css/feature.css.map

@@ -1 +1 @@
-{"version":3,"sources":[],"names":[],"mappings":"","file":"css/feature.css?v=fa9dd37a","sourceRoot":""}
+{"version":3,"sources":[],"names":[],"mappings":"","file":"css/feature.css?v=4da4bfee","sourceRoot":""}

+ 1 - 1
main/assets/mobile/css/global.css

@@ -1,2 +1,2 @@
 body{font-family:Roboto,Droid Sans,Helvetica,Helvetica Neue,Heiti SC,sans-serif}abbr,address,article,aside,audio,b,blockquote,body,canvas,caption,cite,code,dd,del,details,dfn,div,dl,dt,em,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,p,pre,q,samp,section,small,span,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,ul,var,video{margin:0;padding:0;border:none;outline:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}address,caption,cite,code,dfn,td,th,var{font-weight:400;font-style:normal}nav,ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:"";content:none}a,ins{text-decoration:none}table{border-collapse:collapse;border-spacing:0}caption,td,th{text-align:left}a,div,img,input{-webkit-tap-highlight-color:transparent;-webkit-appearance:none}input:focus::-webkit-input-placeholder,textarea:focus::-webkit-input-placeholder{color:transparent}.clearfix:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.fn-hide{display:none}.fn-nocallout{-webkit-touch-callout:none}.fn-noselect{-webkit-user-select:none}.fn-noadjust{-webkit-text-size-adjust:none}.fn-nodrag{-webkit-user-drag:none}
-/*# sourceMappingURL=global.css.map?v=fa9dd37a*/
+/*# sourceMappingURL=global.css.map?v=4da4bfee*/

+ 1 - 1
main/assets/mobile/css/global.css.map

@@ -1 +1 @@
-{"version":3,"sources":[],"names":[],"mappings":"","file":"css/global.css?v=fa9dd37a","sourceRoot":""}
+{"version":3,"sources":[],"names":[],"mappings":"","file":"css/global.css?v=4da4bfee","sourceRoot":""}

File diff suppressed because it is too large
+ 0 - 0
main/assets/mobile/css/index.css


+ 1 - 1
main/assets/mobile/css/index.css.map

@@ -1 +1 @@
-{"version":3,"sources":[],"names":[],"mappings":"","file":"css/index.css?v=fa9dd37a","sourceRoot":""}
+{"version":3,"sources":[],"names":[],"mappings":"","file":"css/index.css?v=4da4bfee","sourceRoot":""}

+ 1 - 1
main/assets/mobile/css/rule.css

@@ -1,2 +1,2 @@
 body{padding:.64rem!important}body h1{padding-top:.64rem;text-align:center;font-size:.4rem;font-weight:700;margin-bottom:.64rem}body h2{line-height:1.6;font-weight:700}body h2,body p{font-size:.32rem}body p{min-height:.32rem;line-height:1.8}body img{max-width:100%}
-/*# sourceMappingURL=rule.css.map?v=fa9dd37a*/
+/*# sourceMappingURL=rule.css.map?v=4da4bfee*/

+ 1 - 1
main/assets/mobile/css/rule.css.map

@@ -1 +1 @@
-{"version":3,"sources":[],"names":[],"mappings":"","file":"css/rule.css?v=fa9dd37a","sourceRoot":""}
+{"version":3,"sources":[],"names":[],"mappings":"","file":"css/rule.css?v=4da4bfee","sourceRoot":""}

+ 14 - 2
main/src/Journal.php

@@ -1054,6 +1054,12 @@ class Journal extends Core
             }
             
             $order_data['type'] = 2;
+            if (!$info['create_uid']) {
+                # 通用兑换码
+                $order_data['type'] = 4;
+                $order_data['buy_num'] = $info['product_num'];
+            }
+            
             $order_data['status'] = 2;
             $order_data['name'] = $product['name'];
 
@@ -1074,8 +1080,14 @@ class Journal extends Core
                 }
             }
 
-            # 增加积分
-            Dever::score($this->data['uid'], 'dh_journal', '兑换小刊', 'act/lib/score.submit?method=code&type=4&id=' . $journal_id, $score, $num);
+            if (isset($info['score']) && $info['score'] < 0) {
+                $score = -1;
+            }
+
+            if ($score >= 0) {
+                # 增加积分
+                Dever::score($this->data['uid'], 'dh_journal', '兑换小刊', 'act/lib/score.submit?method=code&type=4&id=' . $journal_id, $score, $num);
+            }
 
         } else {
             Dever::alert('请输入正确的兑换码');

+ 4 - 2
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 in(1,3) 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,4) 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) {
@@ -69,11 +69,13 @@ class Journal
                     # 已支付
                     $order_yes_num++;
 
-                    if ($v['buy_id']) {
+                    if ($v['buy_id'] && $v['buy_id'] > 0) {
                         $buy = Dever::db('journal/buy_num')->one($v['buy_id']);
                         if ($buy['num']) {
                             $buy_num += $buy['num'];
                         }
+                    } elseif ($v['buy_num'] > 0) {
+                        $buy_num += $v['buy_num'];
                     }
 
                     if ($v['cash']) {

Some files were not shown because too many files changed in this diff