dever 4 years ago
parent
commit
89c2747aa6
4 changed files with 286 additions and 29 deletions
  1. 195 29
      database/info.php
  2. 81 0
      database/user.php
  3. 9 0
      lib/Buy.php
  4. 1 0
      lib/Use.php

+ 195 - 29
database/info.php

@@ -30,13 +30,28 @@ $score = function()
 
 $function = array
 (
-    1 => '消耗积分',
-    2 => '赠送积分',
-    3 => '满减积分',
-    4 => '推荐',
+    1 => '购买',
+    2 => '使用',
+    3 => '持有',
+    //4 => '邀请',
+
+    /*
     5 => '等级',
     6 => '提现',
     11 => '赠送券',
+    */
+);
+
+$buy_condition = array
+(
+    1 => '直接购买',
+    2 => '需要上级购买',
+);
+
+$buy_repeat = array
+(
+    1 => '不可以重复购买',
+    2 => '允许重复购买',
 );
 
 return array
@@ -59,6 +74,13 @@ return array
             'match'     => 'is_numeric',
             'list'      => true,
         ),
+
+        'hr1'       => array
+        (
+            'name'      => '基本设置',
+            'class'     => '',//本项必须填写
+            'attr'      => '',
+        ),
         
         'name'      => array
         (
@@ -88,7 +110,7 @@ return array
         'desc'      => array
         (
             'type'      => 'varchar-500',
-            'name'      => '券描述',
+            'name'      => '券描述-券的描述文字',
             'default'   => '',
             'desc'      => '券描述',
             'match'     => 'option',
@@ -98,7 +120,7 @@ return array
         'value'      => array
         (
             'type'      => 'varchar-80',
-            'name'      => '券面值',
+            'name'      => '券面值-面值描述文字',
             'default'   => '',
             'desc'      => '券面值',
             'match'     => 'is_string',
@@ -106,27 +128,6 @@ return array
             'list'      => true,
         ),
 
-        'qtime'      => array
-        (
-            'type'      => 'int-11',
-            'name'      => '有效期-直接填写天数即可,如有效期为10天,直接填写10',
-            'default'   => '',
-            'desc'      => '有效期',
-            'match'     => 'option',
-            'update'    => 'text',
-        ),
-
-        'qdate'      => array
-        (
-            'type'      => 'int-11',
-            'name'      => '截止时间-选择时间',
-            'default'   => '',
-            'desc'      => '截止时间',
-            'match'     => 'option',
-            'update'    => 'date',
-            'callback'  => 'maketime',
-        ),
-
         'icon'     => array
         (
             'type'      => 'varchar-150',
@@ -143,17 +144,182 @@ return array
             //'large'   => true,
         ),
 
+        'hr2'       => array
+        (
+            'name'      => '功能设置',
+            'class'     => '',//本项必须填写
+            'attr'      => '',
+        ),
+
         'function'      => array
         (
             'type'      => 'varchar-30',
             'name'      => '功能选择',
-            'default'   => '1',
+            'default'   => '1,2',
             'desc'      => '功能选择',
             'match'     => 'is_string',
             'update'    => 'checkbox',
             'option'    => $function,
+            'control'   => 'function',
+        ),
+
+        'buy_condition'      => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '[购买]条件',
+            'default'   => '1',
+            'desc'      => '购买条件',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $buy_condition,
+            'show'      => 'function=1',
         ),
 
+        'buy_repeat'      => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '重复[购买]',
+            'default'   => '1',
+            'desc'      => '重复购买',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $buy_repeat,
+            'show'      => 'function=1',
+        ),
+
+        'buy_set'       => array
+        (
+            'type'      => 'text-1000',
+            'name'      => '[购买]积分设置',
+            'default'   => '',
+            'desc'      => '购买积分设置',
+            'match'     => 'is_string',
+            'show'      => 'function=1',
+            'update'    => array
+            (
+                array
+                (
+                    'col'       => 'score_id',
+                    'name'      => '选择积分',
+                    'default'   => '1',
+                    'desc'      => '选择积分',
+                    'match'     => 'is_numeric',
+                    'update'    => 'select',
+                    'option'    => $score,
+                ),
+
+                array
+                (
+                    'col'       => 'score_num',
+                    'name'      => '所需积分的数量',
+                    'default'   => '0',
+                    'desc'      => '所需积分的数量',
+                    'match'     => 'option',
+                    'update'    => 'text',
+                ),
+            ),
+        ),
+
+        'use_qtime'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '[使用]有效期-直接填写天数即可,如有效期为10天,直接填写10',
+            'default'   => '',
+            'desc'      => '有效期',
+            'match'     => 'option',
+            'update'    => 'text',
+            'show'      => 'function=2',
+        ),
+
+        'use_qdate'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '[使用]截止时间-选择当前券的截止时间,如果有效期和截止时间都填写了,以截止时间为准',
+            'default'   => '',
+            'desc'      => '截止时间',
+            'match'     => 'option',
+            'update'    => 'date',
+            'callback'  => 'maketime',
+            'show'      => 'function=2',
+        ),
+
+        'use_max'       => array
+        (
+            'type'      => 'text-1000',
+            'name'      => '[使用]满减积分',
+            'default'   => '',
+            'desc'      => '满减积分设置',
+            'match'     => 'is_string',
+            'show'      => 'function=2',
+            'update'    => array
+            (
+                array
+                (
+                    'col'       => 'score_id',
+                    'name'      => '选择积分',
+                    'default'   => '1',
+                    'desc'      => '选择积分',
+                    'match'     => 'is_numeric',
+                    'update'    => 'select',
+                    'option'    => $score,
+                ),
+
+                array
+                (
+                    'col'       => 'score_total',
+                    'name'      => '满减积分的总额-如满100减20,则填写100即可',
+                    'default'   => '0',
+                    'desc'      => '满减积分的总额',
+                    'match'     => 'option',
+                    'update'    => 'text',
+                ),
+
+                array
+                (
+                    'col'       => 'score_num',
+                    'name'      => '满减积分的数量-如满100减20,则填写20即可',
+                    'default'   => '0',
+                    'desc'      => '满减积分的数量',
+                    'match'     => 'option',
+                    'update'    => 'text',
+                ),
+            ),
+        ),
+
+        'use_give'       => array
+        (
+            'type'      => 'text-1000',
+            'name'      => '[使用]赠送积分',
+            'default'   => '',
+            'desc'      => '赠送积分设置',
+            'match'     => 'is_string',
+            'show'      => 'function=2',
+            'update'    => array
+            (
+                array
+                (
+                    'col'       => 'score_id',
+                    'name'      => '选择积分',
+                    'default'   => '1',
+                    'desc'      => '选择积分',
+                    'match'     => 'is_numeric',
+                    'update'    => 'select',
+                    'option'    => $score,
+                ),
+
+                array
+                (
+                    'col'       => 'score_num',
+                    'name'      => '赠送积分的数量',
+                    'default'   => '0',
+                    'desc'      => '赠送积分的数量',
+                    'match'     => 'option',
+                    'update'    => 'text',
+                ),
+            ),
+        ),
+
+
         'reorder'       => array
         (
             'type'      => 'int-11',
@@ -161,7 +327,7 @@ return array
             'default'   => '1',
             'desc'      => '请输入排序',
             'match'     => 'option',
-            'update'    => 'text',
+            //'update'    => 'text',
             'search'    => 'order',
             'list'      => true,
             'order'     => 'desc',

+ 81 - 0
database/user.php

@@ -0,0 +1,81 @@
+<?php
+
+return array
+(
+    # 表名
+    'name' => 'user',
+    # 显示给用户看的名称
+    'lang' => '用户拥有的券记录表',
+    # 后台菜单排序
+    'order' => 1,
+    'menu' => false,
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'list'      => true,
+            'order'     => 'desc',
+        ),
+        
+        'uid'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '用户ID',
+            'default'   => '',
+            'desc'      => '用户ID',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'info_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '券id',
+            'default'   => '',
+            'desc'      => '券id',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '录入时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+        
+    ),
+
+    'request' => array
+    (
+        
+    ),
+);

+ 9 - 0
lib/Buy.php

@@ -0,0 +1,9 @@
+<?php
+namespace Quan\Lib;
+
+use Dever;
+
+class Buy
+{
+    
+}

+ 1 - 0
lib/Use.php

@@ -0,0 +1 @@
+Use.php