code.php 4.7 KB

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