card_list.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <?php
  2. $type = array
  3. (
  4. 1 => '未领取',
  5. 2 => '已领取',
  6. );
  7. $card = function()
  8. {
  9. $array = array();
  10. $info = Dever::load('youzan/card-state');
  11. if($info)
  12. {
  13. $array += $info;
  14. }
  15. return $array;
  16. };
  17. return array
  18. (
  19. # 表名
  20. 'name' => 'card_list',
  21. # 显示给用户看的名称
  22. 'lang' => '生成优惠券列表',
  23. 'order' => 90,
  24. # 数据结构
  25. 'struct' => array
  26. (
  27. 'id' => array
  28. (
  29. 'type' => 'int-11',
  30. 'name' => 'ID',
  31. 'default' => '',
  32. 'desc' => '',
  33. 'match' => 'is_numeric',
  34. 'search' => 'order',
  35. 'list' => true,
  36. ),
  37. 'project_id' => array
  38. (
  39. 'type' => 'int-11',
  40. 'name' => '项目',
  41. 'default' => '',
  42. 'desc' => '请输入项目',
  43. 'match' => 'is_numeric',
  44. ),
  45. 'card_id' => array
  46. (
  47. 'type' => 'int-11',
  48. 'name' => '优惠券',
  49. 'default' => '',
  50. 'desc' => '优惠券',
  51. 'match' => 'is_numeric',
  52. 'update' => 'text',
  53. 'search' => 'select',
  54. 'option' => $card,
  55. 'list' => 'Dever::load("youzan/card-one#name", {card_id})',
  56. ),
  57. 'index' => array
  58. (
  59. 'type' => 'int-11',
  60. 'name' => '索引值',
  61. 'default' => '1',
  62. 'desc' => '索引值',
  63. 'match' => 'is_numeric',
  64. 'update' => 'text',
  65. 'list' => true,
  66. ),
  67. 'user' => array
  68. (
  69. 'type' => 'varchar-120',
  70. 'name' => '使用者',
  71. 'default' => '',
  72. 'desc' => '使用者',
  73. 'match' => 'is_string',
  74. 'update' => 'text',
  75. 'search' => 'fulltext',
  76. 'list' => true,
  77. 'edit' => true,
  78. ),
  79. 'group_id' => array
  80. (
  81. 'type' => 'varchar-20',
  82. 'name' => '优惠券组id',
  83. 'default' => '',
  84. 'desc' => '优惠券组id',
  85. 'match' => 'option',
  86. //'search' => 'order',
  87. 'list' => true,
  88. ),
  89. 'code_url' => array
  90. (
  91. 'type' => 'varchar-200',
  92. 'name' => '优惠券地址',
  93. 'default' => '',
  94. 'desc' => '优惠券地址',
  95. 'match' => 'option',
  96. 'search' => 'fulltext',
  97. //'search' => 'order',
  98. 'list' => true,
  99. 'modal' => '查看详情',
  100. ),
  101. 'result' => array
  102. (
  103. 'type' => 'text-255',
  104. 'name' => '有赞返回信息',
  105. 'default' => '',
  106. 'desc' => '有赞返回信息',
  107. 'match' => 'option',
  108. 'update' => 'textarea',
  109. 'list' => true,
  110. 'modal' => '查看详情',
  111. ),
  112. 'status' => array
  113. (
  114. 'type' => 'tinyint-1',
  115. 'name' => '领取状态',
  116. 'default' => '1',
  117. 'desc' => '领取状态',
  118. 'match' => 'is_numeric',
  119. 'update' => 'select',
  120. 'search' => 'select',
  121. 'option' => $type,
  122. 'list' => true,
  123. //'edit' => true,
  124. ),
  125. 'state' => array
  126. (
  127. 'type' => 'tinyint-1',
  128. 'name' => '状态',
  129. 'default' => '1',
  130. 'desc' => '请选择状态',
  131. 'match' => 'is_numeric',
  132. ),
  133. 'cdate' => array
  134. (
  135. 'type' => 'int-11',
  136. 'name' => '更新时间',
  137. 'match' => array('is_numeric', time()),
  138. 'desc' => '',
  139. 'default' => '',
  140. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  141. ),
  142. ),
  143. 'top' => Dever::config('base', 'youzan')->top,
  144. 'manage' => array
  145. (
  146. 'delete' => false,
  147. 'insert' => false,
  148. 'edit' => false,
  149. # 开启批量管理
  150. //'mul' => true,
  151. ),
  152. 'request' => array
  153. (
  154. 'getAll' => array
  155. (
  156. # 匹配的正则或函数 选填项
  157. 'option' => array
  158. (
  159. 'status' => 'yes',
  160. 'card_id' => 'yes',
  161. 'state' => 1,
  162. ),
  163. 'type' => 'all',
  164. 'limit' => '0,100',
  165. 'order' => array('id' => 'desc'),
  166. 'col' => '*',
  167. ),
  168. ),
  169. );