dever 6 years ago
parent
commit
e7544b8549
2 changed files with 28 additions and 4 deletions
  1. 22 2
      youzan/database/card.php
  2. 6 2
      youzan/src/Card.php

+ 22 - 2
youzan/database/card.php

@@ -101,7 +101,7 @@ return array
 		(
 			'type' 		=> 'int-11',
 			'name' 		=> '优惠券结束时间',
-			'match' 	=> 'is_numeric',
+			'match' 	=> 'option',
 			'desc' 		=> '优惠券结束时间',
 			'update'	=> 'date',
 			//'list'		=> 'date("Y-m-d H:i:s", {sdate})',
@@ -112,13 +112,33 @@ return array
 		(
 			'type' 		=> 'int-11',
 			'name' 		=> '优惠券生效时间',
-			'match' 	=> 'is_numeric',
+			'match' 	=> 'option',
 			'desc' 		=> '优惠券生效时间',
 			'update'	=> 'date',
 			//'list'		=> 'date("Y-m-d H:i:s", {sdate})',
 			'callback'	=> 'maketime',
 		),
 
+		'fixed_term'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '固定时长',
+			'default' 	=> '',
+			'desc' 		=> '固定时长',
+			'match' 	=> 'option',
+			'update'	=> 'text',
+		),
+
+		'fixed_begin_term'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '延迟开始的时间',
+			'default' 	=> '',
+			'desc' 		=> '延迟开始的时间',
+			'match' 	=> 'option',
+			'update'	=> 'text',
+		),
+
 		'hr2'		=> array
 		(
 			'name' 		=> '基本设置',

+ 6 - 2
youzan/src/Card.php

@@ -101,8 +101,12 @@ class Card
 			$info['date_type'] = 1;
 
 			$info['expire_notice'] = $info['expire_notice'] - 1;
-			$info['fixed_begin_term'] = 0;
-			$info['fixed_term'] = 0;
+			//$info['fixed_begin_term'] = 0;
+			//$info['fixed_term'] = 0;
+
+			if ($info['fixed_term']) {
+				$info['date_type'] = 2;
+			}
 
 			if (!$info['discount']) {
 				$info['discount'] = 0;