user_card.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <?php
  2. $status = array
  3. (
  4. 1 => '正常',
  5. 2 => '申请退款中',
  6. 3 => '已取消',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'user_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. 'uid' => array
  31. (
  32. 'type' => 'int-11',
  33. 'name' => '购买人名称',
  34. 'default' => '0',
  35. 'desc' => '请选择用户',
  36. 'match' => 'is_numeric',
  37. 'update' => 'text',
  38. //'search' => 'select',
  39. 'search' => array
  40. (
  41. 'api' => 'passport/user-one',
  42. 'col' => 'username',
  43. 'result' => 'id',
  44. ),
  45. 'list' => 'Dever::load("shop/lib/manage.user", {id})',
  46. ),
  47. 'card_id' => array
  48. (
  49. 'type' => 'int-11',
  50. 'name' => '礼品卡名称',
  51. 'default' => '',
  52. 'desc' => '礼品卡名称',
  53. 'match' => 'is_numeric',
  54. 'list' => 'Dever::load("card/info-find#name", {card_id})',
  55. ),
  56. 'total_cash' => array
  57. (
  58. 'type' => 'varchar-11',
  59. 'name' => '总金额',
  60. 'default' => '0',
  61. 'desc' => '总金额',
  62. 'match' => 'is_string',
  63. ),
  64. 'use_cash' => array
  65. (
  66. 'type' => 'varchar-11',
  67. 'name' => '已用金额',
  68. 'default' => '0',
  69. 'desc' => '已用金额',
  70. 'match' => 'is_string',
  71. ),
  72. 'status' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => '状态',
  76. 'default' => '1',
  77. 'desc' => '状态',
  78. 'match' => 'is_numeric',
  79. //'update' => 'select',
  80. 'option' => $status,
  81. 'search' => 'select',
  82. 'list' => true,
  83. 'edit' => true,
  84. ),
  85. 'state' => array
  86. (
  87. 'type' => 'tinyint-1',
  88. 'name' => '状态',
  89. 'default' => '1',
  90. 'desc' => '请选择状态',
  91. 'match' => 'is_numeric',
  92. ),
  93. 'cdate' => array
  94. (
  95. 'type' => 'int-11',
  96. 'name' => '创建时间',
  97. 'match' => array('is_numeric', time()),
  98. 'desc' => '',
  99. # 只有insert时才生效
  100. //'insert' => true,
  101. 'search' => 'date',
  102. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  103. ),
  104. ),
  105. 'manage' => array
  106. (
  107. 'insert' => false,
  108. 'delete' => false,
  109. //'page_list' => 'sell_order_goods',
  110. ),
  111. 'request' => array
  112. (
  113. # 获取单条数据
  114. 'getIds' => array
  115. (
  116. # 匹配的正则或函数 选填项
  117. 'option' => array
  118. (
  119. 'uid' => 'yes',
  120. 'card_id' => 'yes',
  121. 'order_id' => 'yes',
  122. 'status' => 1,
  123. 'state' => 1,
  124. ),
  125. 'type' => 'all',
  126. 'col' => '*|id',
  127. ),
  128. # 获取多条数据
  129. 'getDataByIds' => array
  130. (
  131. # 匹配的正则或函数 选填项
  132. 'option' => array
  133. (
  134. 'ids' => array('yes-id', 'in'),
  135. 'uid' => 'yes',
  136. 'card_id' => 'yes',
  137. 'order_id' => 'yes',
  138. 'state' => 1,
  139. ),
  140. 'type' => 'all',
  141. 'col' => '*',
  142. ),
  143. # 获取多条数据
  144. 'getTotal' => array
  145. (
  146. # 匹配的正则或函数 选填项
  147. 'option' => array
  148. (
  149. 'uid' => 'yes',
  150. 'order_id' => 'yes',
  151. 'status' => array('yes', 'in'),
  152. 'state' => 1,
  153. ),
  154. 'type' => 'count',
  155. 'col' => '*',
  156. ),
  157. ),
  158. );