card_list.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. ),
  78. 'group_id' => array
  79. (
  80. 'type' => 'varchar-20',
  81. 'name' => '优惠券组id',
  82. 'default' => '',
  83. 'desc' => '优惠券组id',
  84. 'match' => 'option',
  85. //'search' => 'order',
  86. 'list' => true,
  87. ),
  88. 'code_url' => array
  89. (
  90. 'type' => 'varchar-200',
  91. 'name' => '优惠券地址',
  92. 'default' => '',
  93. 'desc' => '优惠券地址',
  94. 'match' => 'option',
  95. 'search' => 'fulltext',
  96. //'search' => 'order',
  97. 'list' => true,
  98. 'modal' => '查看详情',
  99. ),
  100. 'result' => array
  101. (
  102. 'type' => 'text-255',
  103. 'name' => '有赞返回信息',
  104. 'default' => '',
  105. 'desc' => '有赞返回信息',
  106. 'match' => 'option',
  107. 'update' => 'textarea',
  108. 'list' => true,
  109. 'modal' => '查看详情',
  110. ),
  111. 'status' => array
  112. (
  113. 'type' => 'tinyint-1',
  114. 'name' => '领取状态',
  115. 'default' => '1',
  116. 'desc' => '领取状态',
  117. 'match' => 'is_numeric',
  118. 'update' => 'select',
  119. 'search' => 'select',
  120. 'option' => $type,
  121. 'list' => true,
  122. //'edit' => true,
  123. ),
  124. 'state' => array
  125. (
  126. 'type' => 'tinyint-1',
  127. 'name' => '状态',
  128. 'default' => '1',
  129. 'desc' => '请选择状态',
  130. 'match' => 'is_numeric',
  131. ),
  132. 'cdate' => array
  133. (
  134. 'type' => 'int-11',
  135. 'name' => '更新时间',
  136. 'match' => array('is_numeric', time()),
  137. 'desc' => '',
  138. 'default' => '',
  139. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  140. ),
  141. ),
  142. 'top' => Dever::config('base', 'youzan')->top,
  143. 'manage' => array
  144. (
  145. 'delete' => false,
  146. 'insert' => false,
  147. 'edit' => false,
  148. # 开启批量管理
  149. //'mul' => true,
  150. ),
  151. 'request' => array
  152. (
  153. 'getAll' => array
  154. (
  155. # 匹配的正则或函数 选填项
  156. 'option' => array
  157. (
  158. 'status' => 'yes',
  159. 'card_id' => 'yes',
  160. 'state' => 1,
  161. ),
  162. 'type' => 'all',
  163. 'limit' => '0,100',
  164. 'order' => array('id' => 'desc'),
  165. 'col' => '*',
  166. ),
  167. ),
  168. );