dever hace 7 años
padre
commit
c470d49f13

+ 2 - 0
main/template/mobile/task/list.php

@@ -50,6 +50,8 @@ $view
     )
 )
 
+->fetch('.topbg@style', '<{Dever::load("task/info.all") ? "" : "display:none"}>')
+
 # 暂无记录
 ->append('.wrapper', '<div id="page" dever-page-link="<{Dever::pageInfo()["link"]}>" dever-page-list=".wrapper"></div><{Dever::load("task/info.all") ? "" : \'<section class="no-result">
         <section class="no-notice-wrapper">

+ 13 - 2
task/database/user_cash.php

@@ -62,7 +62,7 @@ return array
 
 		'score'		=> array
 		(
-			'type' 		=> 'int-11',
+			'type' 		=> 'varchar-11',
 			'name' 		=> '兑现积分',
 			'default' 	=> '',
 			'desc' 		=> '兑现积分',
@@ -74,7 +74,7 @@ return array
 
 		'cash'		=> array
 		(
-			'type' 		=> 'int-11',
+			'type' 		=> 'varchar-11',
 			'name' 		=> '兑换金额',
 			'default' 	=> '',
 			'desc' 		=> '兑换金额',
@@ -152,6 +152,17 @@ return array
 			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
 		),
 	),
+
+	# 更新表结构
+	'alter' => array
+	(
+		1 => array
+		(
+			array('update', 'score', 'score', 'varchar-11 0 积分'),
+			array('update', 'cash', 'cash', 'varchar-11 0 兑换金额'),
+		),
+		'version' => 1,
+	),
 	
 	'manage' => array
 	(

+ 11 - 1
task/database/user_level.php

@@ -46,7 +46,7 @@ return array
 
 		'score'		=> array
 		(
-			'type' 		=> 'int-11',
+			'type' 		=> 'varchar-11',
 			'name' 		=> '等级所需积分',
 			'default' 	=> '0',
 			'desc' 		=> '等级所需积分',
@@ -104,6 +104,16 @@ return array
 			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
 		),
 	),
+
+	# 更新表结构
+	'alter' => array
+	(
+		1 => array
+		(
+			array('update', 'score', 'score', 'varchar-11 0 积分'),
+		),
+		'version' => 1,
+	),
 	
 	'manage' => array
 	(

+ 13 - 2
task/database/user_report.php

@@ -147,7 +147,7 @@ return array
 
 		'score'		=> array
 		(
-			'type' 		=> 'int-11',
+			'type' 		=> 'varchar-11',
 			'name' 		=> '积分',
 			'default' 	=> '',
 			'desc' 		=> '积分',
@@ -157,7 +157,7 @@ return array
 
 		'group_score'		=> array
 		(
-			'type' 		=> 'int-11',
+			'type' 		=> 'varchar-11',
 			'name' 		=> '下线提成酬劳',
 			'default' 	=> '0',
 			'match' 	=> '下线提成酬劳',
@@ -200,6 +200,17 @@ return array
 			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
 		),
 	),
+
+	# 更新表结构
+	'alter' => array
+	(
+		1 => array
+		(
+			array('update', 'score', 'score', 'varchar-11 0 积分'),
+			array('update', 'group_score', 'group_score', 'varchar-11 0 下线提成酬劳'),
+		),
+		'version' => 1,
+	),
 	
 	'manage' => array
 	(

+ 11 - 1
task/database/user_score.php

@@ -43,7 +43,7 @@ return array
 
 		'score'		=> array
 		(
-			'type' 		=> 'int-11',
+			'type' 		=> 'varchar-11',
 			'name' 		=> '可用积分',
 			'default' 	=> '0',
 			'desc' 		=> '可用积分',
@@ -84,6 +84,16 @@ return array
 			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
 		),
 	),
+
+	# 更新表结构
+	'alter' => array
+	(
+		1 => array
+		(
+			array('update', 'score', 'score', 'varchar-11 0 积分'),
+		),
+		'version' => 1,
+	),
 	
 	'manage' => array
 	(

+ 13 - 2
task/database/user_score_log.php

@@ -75,7 +75,7 @@ return array
 
 		'score'		=> array
 		(
-			'type' 		=> 'int-11',
+			'type' 		=> 'varchar-11',
 			'name' 		=> '积分',
 			'default' 	=> '',
 			'desc' 		=> '积分',
@@ -86,7 +86,7 @@ return array
 
 		'cash'		=> array
 		(
-			'type' 		=> 'int-11',
+			'type' 		=> 'varchar-11',
 			'name' 		=> '兑换现金',
 			'default' 	=> '',
 			'desc' 		=> '兑换现金',
@@ -201,6 +201,17 @@ return array
 			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
 		),
 	),
+
+	# 更新表结构
+	'alter' => array
+	(
+		1 => array
+		(
+			array('update', 'score', 'score', 'varchar-11 0 积分'),
+			array('update', 'cash', 'cash', 'varchar-11 0 兑换金额'),
+		),
+		'version' => 1,
+	),
 	
 	'manage' => array
 	(

+ 3 - 0
task/lib/Manage.php

@@ -109,6 +109,7 @@ class Manage
 	{
 		$config = Dever::db('main/config')->one();
 		$info = Dever::db('task/user_cash')->one($id);
+		$score = Dever::db('task/user_score')->one(array('uid' => $info['uid']));
 		$user = Dever::db('task/user_info')->one(array('uid' => $info['uid']));
 		if ($info['type'] == 1) {
 			$type = '微信';
@@ -123,6 +124,8 @@ class Manage
 		$data['兑换金额'] = $info['cash'] . '元';
 		$data['兑现类型'] = $type;
 		$data['兑现账号'] = $account;
+		$data['当前积分'] = $score['score'] . $config['score_name'];
+		$data['剩余积分'] = ($score['score'] - $info['score']) . $config['score_name'];
 
 		$html = Dever::table($data);
 

+ 2 - 2
task/src/Info.php

@@ -266,10 +266,10 @@ class Info extends Base
         # 大于1都不能点击
         $button = 1;
 
-        if ($this->data['time'] > $data['edate']) {
+        if ($this->data['time'] > $data['edate'] || $data['status'] == 3) {
             # 任务已到期
             $button = 2;
-        } elseif ($this->data['time'] < $data['sdate']) {
+        } elseif ($this->data['time'] < $data['sdate'] || $data['status'] == 2) {
             # 任务未开始
             $button = 10;
         } elseif (isset($this->data['uid']) && $this->data['uid']) {

+ 3 - 3
task/src/Score.php

@@ -37,7 +37,7 @@ class Score extends Base
         $user['score_name_ext'] = $this->data['config']['score_name_ext'];
         $user['exchange'] = $this->data['config']['exchange'];
         $user['exchange_min'] = $this->data['config']['exchange_min'];
-        $user['cash'] = floor($user['score']/$user['exchange']);
+        $user['cash'] = round($user['score']/$user['exchange'], 2);
 
         if ($user['exchange_min'] > 0) {
         	$user['desc'] = '最低兑换数量'.$user['exchange_min'].$user['score_name'];
@@ -83,7 +83,7 @@ class Score extends Base
 		}
 
         $exchange = $this->data['config']['exchange'];
-		$insert['cash'] = floor($score/$exchange);
+		$insert['cash'] = round($score/$exchange, 2);
 		$insert['score'] = $score;
 		$insert['uid'] = $user['uid'];
 		$insert['type'] = $type;
@@ -96,7 +96,7 @@ class Score extends Base
 		Dever::db('task/user_score_log')->insert($insert);
 
 		# 剩余数量
-		$sur_score = $user['score'] - $score;
+		$sur_score = round($user['score'] - $score, 2);
 
 		$update['score'] = $sur_score;
 		$update['where_id'] = $user['id'];