order.php 4.9 KB

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