order_card.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <?php
  2. $status = array
  3. (
  4. 1 => '正常',
  5. 2 => '申请退款中',
  6. 3 => '已取消',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'order_card',
  12. # 显示给用户看的名称
  13. 'lang' => '礼品卡子订单',
  14. 'menu' => false,
  15. 'status' => $status,
  16. # 数据结构
  17. 'struct' => array
  18. (
  19. 'id' => array
  20. (
  21. 'type' => 'int-11',
  22. 'name' => 'ID',
  23. 'default' => '',
  24. 'desc' => '',
  25. 'match' => 'is_numeric',
  26. 'search' => 'order',
  27. 'update' => 'hidden',
  28. //'list' => true,
  29. ),
  30. 'order_id' => array
  31. (
  32. 'type' => 'int-11',
  33. 'name' => '订单表id',
  34. 'default' => '',
  35. 'desc' => '订单表id',
  36. 'match' => 'is_numeric',
  37. ),
  38. 'uid' => array
  39. (
  40. 'type' => 'int-11',
  41. 'name' => '购买人名称',
  42. 'default' => '0',
  43. 'desc' => '请选择用户',
  44. 'match' => 'is_numeric',
  45. 'update' => 'text',
  46. //'search' => 'select',
  47. 'search' => array
  48. (
  49. 'api' => 'passport/user-one',
  50. 'col' => 'username',
  51. 'result' => 'id',
  52. ),
  53. 'list' => 'Dever::load("shop/lib/manage.user", {id})',
  54. ),
  55. 'card_id' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '礼品卡名称',
  59. 'default' => '',
  60. 'desc' => '礼品卡名称',
  61. 'match' => 'is_numeric',
  62. 'list' => 'Dever::load("card/info-find#name", {card_id})',
  63. ),
  64. 'city' => array
  65. (
  66. 'type' => 'int-11',
  67. 'name' => '城市',
  68. 'default' => '',
  69. 'desc' => '城市',
  70. 'match' => 'option',
  71. //'update' => 'text',
  72. ),
  73. 'price' => array
  74. (
  75. 'type' => 'varchar-50',
  76. 'name' => '单价',
  77. 'default' => '',
  78. 'desc' => '单价',
  79. 'match' => 'option',
  80. 'update' => 'text',
  81. 'list' => true,
  82. ),
  83. 'num' => array
  84. (
  85. 'type' => 'int-11',
  86. 'name' => '购买数量',
  87. 'default' => '',
  88. 'desc' => '购买数量',
  89. 'match' => 'is_numeric',
  90. 'search' => 'select',
  91. 'list' => true,
  92. ),
  93. 'cards' => array
  94. (
  95. 'type' => 'varchar-2000',
  96. 'name' => '卡号',
  97. 'default' => '',
  98. 'desc' => '卡号',
  99. 'match' => 'option',
  100. 'list' => true,
  101. ),
  102. 'status' => array
  103. (
  104. 'type' => 'int-11',
  105. 'name' => '状态',
  106. 'default' => '1',
  107. 'desc' => '状态',
  108. 'match' => 'is_numeric',
  109. //'update' => 'select',
  110. 'option' => $status,
  111. 'search' => 'select',
  112. 'list' => true,
  113. 'edit' => true,
  114. ),
  115. 'state' => array
  116. (
  117. 'type' => 'tinyint-1',
  118. 'name' => '状态',
  119. 'default' => '1',
  120. 'desc' => '请选择状态',
  121. 'match' => 'is_numeric',
  122. ),
  123. 'cdate' => array
  124. (
  125. 'type' => 'int-11',
  126. 'name' => '创建时间',
  127. 'match' => array('is_numeric', time()),
  128. 'desc' => '',
  129. # 只有insert时才生效
  130. //'insert' => true,
  131. 'search' => 'date',
  132. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  133. ),
  134. ),
  135. 'manage' => array
  136. (
  137. 'insert' => false,
  138. 'delete' => false,
  139. 'page_list' => 'order_card',
  140. ),
  141. 'request' => array
  142. (
  143. # 获取单条数据
  144. 'getIds' => array
  145. (
  146. # 匹配的正则或函数 选填项
  147. 'option' => array
  148. (
  149. 'uid' => 'yes',
  150. 'card_id' => 'yes',
  151. 'order_id' => 'yes',
  152. 'status' => 1,
  153. 'state' => 1,
  154. ),
  155. 'type' => 'all',
  156. 'col' => '*|id',
  157. ),
  158. # 获取多条数据
  159. 'getDataByIds' => array
  160. (
  161. # 匹配的正则或函数 选填项
  162. 'option' => array
  163. (
  164. 'ids' => array('yes-id', 'in'),
  165. 'uid' => 'yes',
  166. 'card_id' => 'yes',
  167. 'order_id' => 'yes',
  168. 'state' => 1,
  169. ),
  170. 'type' => 'all',
  171. 'col' => '*',
  172. ),
  173. # 获取多条数据
  174. 'getTotal' => array
  175. (
  176. # 匹配的正则或函数 选填项
  177. 'option' => array
  178. (
  179. 'uid' => 'yes',
  180. 'order_id' => 'yes',
  181. 'status' => array('yes', 'in'),
  182. 'state' => 1,
  183. ),
  184. 'type' => 'count',
  185. 'col' => '*',
  186. ),
  187. ),
  188. );