code.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <?php
  2. $status = array
  3. (
  4. 1 => '已生成',
  5. 2 => '未兑换',
  6. 3 => '已使用',
  7. 5 => '已过期',
  8. );
  9. return array
  10. (
  11. # 表名
  12. 'name' => 'code',
  13. # 显示给用户看的名称
  14. 'lang' => '礼品卡卡号',
  15. 'status' => $status,
  16. # 后台菜单排序
  17. 'order' => 99,
  18. 'menu' => false,
  19. # 数据结构
  20. 'struct' => array
  21. (
  22. 'id' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => 'ID',
  26. 'default' => '',
  27. 'desc' => '',
  28. 'match' => 'is_numeric',
  29. 'search' => 'order',
  30. 'list' => true,
  31. 'order' => 'desc',
  32. ),
  33. 'card_id' => array
  34. (
  35. 'type' => 'int-11',
  36. 'name' => '礼品卡',
  37. 'default' => '',
  38. 'desc' => '礼品卡',
  39. 'match' => 'is_numeric',
  40. 'update' => 'hidden',
  41. 'value' => Dever::input('search_option_card_id'),
  42. 'list' => 'Dever::load("card/info-find#name", "{card_id}")',
  43. ),
  44. 'card' => array
  45. (
  46. 'type' => 'varchar-32',
  47. 'name' => '卡号',
  48. 'default' => '',
  49. 'desc' => '卡号',
  50. 'match' => 'is_string',
  51. 'update' => 'text',
  52. 'search' => 'fulltext',
  53. 'list' => true,
  54. ),
  55. 'status' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '使用状态',
  59. 'default' => '1',
  60. 'desc' => '使用状态',
  61. 'match' => 'is_numeric',
  62. 'option' => $status,
  63. 'search' => 'select',
  64. 'update' => 'select',
  65. 'list' => true,
  66. //'mul' => array(1 => '恢复使用', 4 => '已作废'),
  67. ),
  68. 'uid' => array
  69. (
  70. 'type' => 'int-11',
  71. 'name' => '用户信息',
  72. 'default' => '0',
  73. 'desc' => '用户信息',
  74. 'match' => 'is_numeric',
  75. 'list_name' => '兑换信息',
  76. //'list' => 'Dever::load("goods/lib/manage.showUserInfo", "{id}")',
  77. ),
  78. 'shop_id' => array
  79. (
  80. 'type' => 'int-11',
  81. 'name' => '兑换门店',
  82. 'default' => '',
  83. 'desc' => '兑换门店',
  84. 'match' => 'is_numeric',
  85. ),
  86. 'order_id' => array
  87. (
  88. 'type' => 'int-11',
  89. 'name' => '订单表id',
  90. 'default' => '',
  91. 'desc' => '订单表id',
  92. 'match' => 'is_numeric',
  93. ),
  94. 'ddate' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '兑换时间',
  98. 'match' => 'option',
  99. 'default' => '',
  100. 'desc' => '',
  101. //'search' => 'date',
  102. ),
  103. 'edate' => array
  104. (
  105. 'type' => 'int-11',
  106. 'name' => '失效时间',
  107. 'match' => 'is_numeric',
  108. 'default' => '',
  109. 'desc' => '',
  110. 'list' => 'date("Y-m-d H:i:s", {edate})',
  111. ),
  112. 'state' => array
  113. (
  114. 'type' => 'tinyint-1',
  115. 'name' => '状态',
  116. 'default' => '1',
  117. 'desc' => '请选择状态',
  118. 'match' => 'is_numeric',
  119. ),
  120. 'cdate' => array
  121. (
  122. 'type' => 'int-11',
  123. 'name' => '生成时间',
  124. 'match' => array('is_numeric', time()),
  125. 'desc' => '',
  126. # 只有insert时才生效
  127. 'insert' => true,
  128. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  129. ),
  130. ),
  131. 'manage' => array
  132. (
  133. 'excel' => true,
  134. 'delete' => false,
  135. 'edit' => false,
  136. 'insert' => false,
  137. // 'mul' => '{type} == 1 || {type} == 4',
  138. 'list_button' => array
  139. (
  140. //'oper' => array('作废', 'goods/lib/manage.drop?id={id}', '{type} == 1'),
  141. //'oper2' => array('恢复使用', 'goods/lib/manage.recovery?id={id}', '{type} == 4'),
  142. ),
  143. ),
  144. # 索引
  145. 'index' => array
  146. (
  147. # 索引名 => 索引id
  148. 1 => array
  149. (
  150. 'card' => 'card'
  151. ),
  152. 'version' => 1,
  153. ),
  154. 'request' => array
  155. (
  156. ),
  157. );