dever 6 years ago
parent
commit
ab5a4a27fa
5 changed files with 36 additions and 4 deletions
  1. 2 2
      code/database/config.php
  2. 12 1
      code/database/info.php
  3. 2 1
      code/lib/Core.php
  4. 8 0
      journal/lib/Manage.php
  5. 12 0
      main/src/Journal.php

+ 2 - 2
code/database/config.php

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

+ 12 - 1
code/database/info.php

@@ -136,7 +136,7 @@ return array
         (
             'type'      => 'int-11',
             'name'      => '兑换本数',
-            'default'   => '1',
+            'default'   => '0',
             'desc'      => '兑换本数',
             'match'     => 'option',
             'update'    => 'text',
@@ -234,6 +234,17 @@ return array
         'col' => 'cate_id',
     ),
 
+    # 更新表结构
+	'alter' => array
+	(
+		2 => array
+		(
+			array('update', 'product_num', 'product_num', 'varchar-32 0 兑换本数'),
+			//array('add', 'config', 'config', 'int-11 1 配置'),
+		),
+		'version' => 2,
+	),
+
 	'manage' => array
 	(
 		'excel'	=> true,

+ 2 - 1
code/lib/Core.php

@@ -6,7 +6,7 @@ use Dever;
 
 class Core
 {
-	public function createCode($product, $cate_id, $product_id, $seller_id, $product_num = 1, $create_uid = -1, $order_id = false, $score = 0)
+	public function createCode($product, $cate_id, $product_id, $seller_id, $product_num = 0, $create_uid = -1, $order_id = false, $score = 0)
 	{
 		$code = Dever::rand(8, 0);
 		$data['code'] = $code;
@@ -20,6 +20,7 @@ class Core
 		$data['product_id'] = $product_id;
 		$data['seller_id'] = $seller_id;
 		$data['product_num'] = $product_num;
+		
 		$data['type'] = 1;
 		if ($order_id) {
 			$data['order_id'] = $order_id;

+ 8 - 0
journal/lib/Manage.php

@@ -403,4 +403,12 @@ class Manage
             return $info['num'] * $journal['cash'] . '元';
         }
     }
+
+    public function mobileTemplate_api()
+    {
+        $host = 'http://' . $_SERVER['HTTP_HOST'] . '/wonderful/';
+        $file = $host . 'doc/mobile.xlsx';
+
+        Dever::location($file);
+    }
 }

+ 12 - 0
main/src/Journal.php

@@ -452,6 +452,18 @@ class Journal extends Core
             $this->data['info']['vip'] = 1;
             $this->setButton('read', 1);
         }
+
+        # 是否在外站订阅过
+        $user = Dever::db('passport/user')->one($uid);
+        if ($user && $user['mobile']) {
+            $mobileWhere['mobile'] = $user['mobile'];
+            $mobileWhere['product_id'] = $info['id'];
+            $mobile = Dever::db('journal/mobile')->one($mobileWhere);
+            if ($mobile) {
+                $this->data['info']['subscribe'] = 1;
+                $this->setButton('read', 1);
+            }
+        }
     }
 
     private function setButton($key = false, $status = false, $name = false)