order.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <?php
  2. $config = array
  3. (
  4. # 表名
  5. 'name' => 'order',
  6. # 显示给用户看的名称
  7. 'lang' => '商品订单',
  8. 'order' => 300,
  9. 'menu' => false,
  10. # 数据结构 不同的字段放这里
  11. 'struct' => array
  12. (
  13. 'id' => array
  14. (
  15. 'type' => 'int-11',
  16. 'name' => 'ID',
  17. 'default' => '',
  18. 'desc' => '',
  19. 'match' => 'is_numeric',
  20. //'list' => true,
  21. ),
  22. 'parent_uid' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => '邀请人',
  26. 'default' => '0',
  27. 'desc' => '请选择用户',
  28. 'match' => 'is_numeric',
  29. 'update' => 'text',
  30. //'search' => 'select',
  31. 'search' => array
  32. (
  33. 'api' => 'passport/user-all',
  34. 'col' => 'username',
  35. 'result' => 'id',
  36. ),
  37. 'list' => '{parent_uid} > 0 ? Dever::load("passport/user-one#username", {parent_uid}) : "无邀请人"',
  38. ),
  39. 'uid' => array
  40. (
  41. 'type' => 'int-11',
  42. 'name' => '购买人',
  43. 'default' => '0',
  44. 'desc' => '请选择用户',
  45. 'match' => 'is_numeric',
  46. 'update' => 'text',
  47. //'search' => 'select',
  48. 'search' => array
  49. (
  50. 'api' => 'passport/user-all',
  51. 'col' => 'username',
  52. 'result' => 'id',
  53. ),
  54. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  55. ),
  56. 'type' => array
  57. (
  58. 'type' => 'varchar-32',
  59. 'name' => '所属数据源',
  60. 'default' => '',
  61. 'desc' => '所属数据源',
  62. 'match' => 'is_string',
  63. 'list' => true,
  64. ),
  65. 'type_id' => array
  66. (
  67. 'type' => 'int-11',
  68. 'name' => '数据源id',
  69. 'default' => '',
  70. 'desc' => '数据源id',
  71. 'match' => 'is_numeric',
  72. 'list' => true,
  73. ),
  74. 'info_id' => array
  75. (
  76. 'type' => 'int-11',
  77. 'name' => '商品ID',
  78. 'default' => '',
  79. 'desc' => '商品ID',
  80. 'match' => 'is_numeric',
  81. 'update' => 'text',
  82. 'list' => true,
  83. ),
  84. 'sku_id' => array
  85. (
  86. 'type' => 'int-11',
  87. 'name' => '商品SKUID',
  88. 'default' => '',
  89. 'desc' => '商品SKUID',
  90. 'match' => 'is_numeric',
  91. 'update' => 'text',
  92. 'list' => true,
  93. ),
  94. 'order_id' => array
  95. (
  96. 'type' => 'varchar-100',
  97. 'name' => '订单id',
  98. 'default' => '',
  99. 'desc' => '订单id',
  100. 'match' => 'is_string',
  101. 'update' => 'text',
  102. 'list' => true,
  103. ),
  104. 'name' => array
  105. (
  106. 'type' => 'varchar-100',
  107. 'name' => '商品名称',
  108. 'default' => '',
  109. 'desc' => '商品名称',
  110. 'match' => 'is_string',
  111. 'update' => 'text',
  112. 'list' => true,
  113. ),
  114. 'cash' => array
  115. (
  116. 'type' => 'varchar-100',
  117. 'name' => '价格',
  118. 'default' => '',
  119. 'desc' => '价格',
  120. 'match' => 'is_string',
  121. 'update' => 'text',
  122. 'list' => true,
  123. ),
  124. 'num' => array
  125. (
  126. 'type' => 'int-11',
  127. 'name' => '数量',
  128. 'default' => '',
  129. 'desc' => '数量',
  130. 'match' => 'is_string',
  131. 'update' => 'text',
  132. 'list' => true,
  133. ),
  134. 'source' => array
  135. (
  136. 'type' => 'varchar-100',
  137. 'name' => '来源',
  138. 'default' => '',
  139. 'desc' => '来源',
  140. 'match' => 'is_string',
  141. 'update' => 'text',
  142. //'list' => true,
  143. ),
  144. 'status' => array
  145. (
  146. 'type' => 'tinyint-1',
  147. 'name' => '订单状态',
  148. 'default' => '1',
  149. 'desc' => '订单状态',
  150. 'match' => 'is_numeric',
  151. ),
  152. 'state' => array
  153. (
  154. 'type' => 'tinyint-1',
  155. 'name' => '数据状态',
  156. 'default' => '1',
  157. 'desc' => '请选择状态',
  158. 'match' => 'is_numeric',
  159. ),
  160. 'cdate' => array
  161. (
  162. 'type' => 'int-11',
  163. 'name' => '发布时间',
  164. 'match' => array('is_numeric', time()),
  165. 'desc' => '',
  166. # 只有insert时才生效
  167. 'insert' => true,
  168. //'search' => 'date',
  169. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  170. ),
  171. ),
  172. 'manage' => array
  173. (
  174. 'insert' => false,
  175. 'edit' => false,
  176. 'delete' => false,
  177. ),
  178. # request 请求接口定义
  179. 'request' => array
  180. (
  181. # 分页
  182. 'getData' => array
  183. (
  184. # 匹配的正则或函数 选填项
  185. 'option' => array
  186. (
  187. 'uid' => 'yes',
  188. 'type' => 'yes',
  189. 'type_id' => 'yes',
  190. 'status' => 'yes',
  191. 'state' => 1,
  192. ),
  193. 'type' => 'all',
  194. 'order' => array('id' => 'desc'),
  195. 'page' => array(10, 'list'),
  196. 'col' => '*',
  197. ),
  198. ),
  199. );
  200. return $config;