order.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <?php
  2. $type = Dever::config('base', 'pay')->pay['type'];
  3. $account = function()
  4. {
  5. return Dever::db('pay/account')->state();
  6. };
  7. $project = function()
  8. {
  9. return Dever::db('pay/project')->state();
  10. };
  11. $status = Dever::config('base', 'pay')->pay['status'];
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'order',
  16. # 显示给用户看的名称
  17. 'lang' => '订单管理',
  18. 'order' => 1,
  19. # 数据结构
  20. 'struct' => array
  21. (
  22. 'id' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => 'ID',
  26. 'default' => '',
  27. 'desc' => '',
  28. 'match' => 'is_numeric',
  29. 'search' => 'order',
  30. //'list' => true,
  31. ),
  32. 'uid' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '用户',
  36. 'default' => '1',
  37. 'desc' => '用户',
  38. 'match' => 'is_numeric',
  39. 'update' => 'text',
  40. /*
  41. 'search' => array
  42. (
  43. 'api' => 'passport/user-all',
  44. 'col' => 'username',
  45. 'result' => 'id',
  46. ),
  47. 'list' => 'Dever::load("passport/user-one#username", {uid})',
  48. */
  49. ),
  50. 'username' => array
  51. (
  52. 'type' => 'varchar-200',
  53. 'name' => '用户名称',
  54. 'default' => '',
  55. 'desc' => '用户名称',
  56. 'match' => 'is_string',
  57. 'update' => 'text',
  58. 'search' => 'fulltext',
  59. 'list' => true,
  60. ),
  61. 'name' => array
  62. (
  63. 'type' => 'varchar-200',
  64. 'name' => '订单名称',
  65. 'default' => '',
  66. 'desc' => '订单名称',
  67. 'match' => 'is_string',
  68. 'update' => 'text',
  69. 'search' => 'fulltext',
  70. 'list' => true,
  71. ),
  72. 'order_id' => array
  73. (
  74. 'type' => 'varchar-100',
  75. 'name' => '订单id',
  76. 'default' => '',
  77. 'desc' => '订单id',
  78. 'match' => 'is_numeric',
  79. 'update' => 'text',
  80. 'list' => true,
  81. ),
  82. 'type' => array
  83. (
  84. 'type' => 'varchar-30',
  85. 'name' => '支付类型',
  86. 'default' => 'wechat',
  87. 'desc' => '支付类型',
  88. 'match' => 'is_string',
  89. 'update' => 'radio',
  90. 'option' => $type,
  91. 'search' => 'select',
  92. 'list' => true,
  93. 'control' => 'type',
  94. ),
  95. 'product_id' => array
  96. (
  97. 'type' => 'varchar-800',
  98. 'name' => '产品id-可能为多个',
  99. 'default' => '',
  100. 'desc' => '产品id',
  101. 'match' => 'is_string',
  102. 'update' => 'text',
  103. ),
  104. 'account_id' => array
  105. (
  106. 'type' => 'int-11',
  107. 'name' => '支付账户',
  108. 'default' => '1',
  109. 'desc' => '支付账户',
  110. 'match' => 'is_numeric',
  111. 'update' => 'select',
  112. 'option' => $account,
  113. 'search' => 'select',
  114. 'list' => true,
  115. ),
  116. 'project_id' => array
  117. (
  118. 'type' => 'int-11',
  119. 'name' => '所属项目',
  120. 'default' => '0',
  121. 'desc' => '所属项目',
  122. 'match' => 'is_numeric',
  123. 'update' => 'select',
  124. 'option' => $project,
  125. 'search' => 'select',
  126. 'list' => true,
  127. ),
  128. 'cash' => array
  129. (
  130. 'type' => 'varchar-11',
  131. 'name' => '金额',
  132. 'default' => '',
  133. 'desc' => '金额',
  134. 'match' => 'is_string',
  135. 'update' => 'text',
  136. 'list' => true,
  137. ),
  138. 'status' => array
  139. (
  140. 'type' => 'tinyint-1',
  141. 'name' => '支付状态',
  142. 'default' => '1',
  143. 'desc' => '支付状态',
  144. 'match' => 'is_numeric',
  145. 'update' => 'radio',
  146. 'option' => $status,
  147. 'search' => 'select',
  148. 'list' => 'Dever::load("pay/lib/manage.showOrderStatus", "{id}")',
  149. 'control' => 'status',
  150. ),
  151. 'status_desc' => array
  152. (
  153. 'type' => 'varchar-300',
  154. 'name' => '支付状态说明',
  155. 'default' => '',
  156. 'desc' => '请输入支付状态说明',
  157. 'match' => 'option',
  158. 'update' => 'textarea',
  159. 'show' => 'status=3',
  160. ),
  161. 'tk_pic' => array
  162. (
  163. 'type' => 'varchar-150',
  164. 'name' => '退款截图',
  165. 'default' => '',
  166. 'desc' => '退款截图',
  167. 'match' => 'is_string',
  168. 'update' => 'image',
  169. 'key' => 1
  170. ),
  171. 'tk_time' => array
  172. (
  173. 'type' => 'int-11',
  174. 'name' => '退款时间',
  175. 'default' => '',
  176. 'desc' => '退款时间',
  177. 'match' => 'option',
  178. //'list' => true,
  179. //'update' => 'date',
  180. 'callback' => 'maketime',
  181. 'show' => 'status=5',
  182. ),
  183. 'tk_admin' => array
  184. (
  185. 'type' => 'int-11',
  186. 'name' => '退款审核人',
  187. 'default' => '1',
  188. 'desc' => '退款审核人',
  189. 'match' => 'option',
  190. //'list' => true,
  191. 'show' => 'status=5',
  192. ),
  193. 'tk_desc' => array
  194. (
  195. 'type' => 'varchar-300',
  196. 'name' => '退款备注',
  197. 'default' => '',
  198. 'desc' => '退款备注',
  199. 'match' => 'option',
  200. 'update' => 'textarea',
  201. //'show' => 'status=5',
  202. ),
  203. 'param' => array
  204. (
  205. 'type' => 'text-255',
  206. 'name' => '支付信息-用于二次支付',
  207. 'default' => '',
  208. 'desc' => '支付信息',
  209. 'match' => 'option',
  210. ),
  211. 'state' => array
  212. (
  213. 'type' => 'tinyint-1',
  214. 'name' => '状态',
  215. 'default' => '1',
  216. 'desc' => '请选择状态',
  217. 'match' => 'is_numeric',
  218. ),
  219. 'cdate' => array
  220. (
  221. 'type' => 'int-11',
  222. 'name' => '申请时间',
  223. 'match' => array('is_numeric', time()),
  224. 'desc' => '',
  225. # 只有insert时才生效
  226. 'insert' => true,
  227. 'search' => 'date',
  228. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  229. ),
  230. ),
  231. 'manage' => array
  232. (
  233. 'insert' => false,
  234. 'edit' => false,
  235. 'delete' => false,
  236. 'excel' => true,
  237. /*
  238. 'list_button' => array(
  239. 'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} > 1'),
  240. ),
  241. */
  242. ),
  243. );