order.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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. 'search' => 'fulltext',
  81. 'list' => true,
  82. ),
  83. 'type' => array
  84. (
  85. 'type' => 'varchar-30',
  86. 'name' => '支付类型',
  87. 'default' => 'wechat',
  88. 'desc' => '支付类型',
  89. 'match' => 'is_string',
  90. 'update' => 'radio',
  91. 'option' => $type,
  92. 'search' => 'select',
  93. 'list' => true,
  94. 'control' => 'type',
  95. ),
  96. 'product_id' => array
  97. (
  98. 'type' => 'varchar-800',
  99. 'name' => '产品id-可能为多个',
  100. 'default' => '',
  101. 'desc' => '产品id',
  102. 'match' => 'is_string',
  103. 'update' => 'text',
  104. ),
  105. 'account_id' => array
  106. (
  107. 'type' => 'int-11',
  108. 'name' => '支付账户',
  109. 'default' => '1',
  110. 'desc' => '支付账户',
  111. 'match' => 'is_numeric',
  112. 'update' => 'select',
  113. 'option' => $account,
  114. 'search' => 'select',
  115. 'list' => true,
  116. ),
  117. 'project_id' => array
  118. (
  119. 'type' => 'int-11',
  120. 'name' => '所属项目',
  121. 'default' => '0',
  122. 'desc' => '所属项目',
  123. 'match' => 'is_numeric',
  124. 'update' => 'select',
  125. 'option' => $project,
  126. 'search' => 'select',
  127. 'list' => true,
  128. ),
  129. 'cash' => array
  130. (
  131. 'type' => 'varchar-11',
  132. 'name' => '金额',
  133. 'default' => '',
  134. 'desc' => '金额',
  135. 'match' => 'is_string',
  136. 'update' => 'text',
  137. 'list' => true,
  138. ),
  139. 'status' => array
  140. (
  141. 'type' => 'tinyint-1',
  142. 'name' => '支付状态',
  143. 'default' => '1',
  144. 'desc' => '支付状态',
  145. 'match' => 'is_numeric',
  146. 'update' => 'radio',
  147. 'option' => $status,
  148. 'search' => 'select',
  149. 'list' => 'Dever::load("pay/lib/manage.showOrderStatus", "{id}")',
  150. 'control' => 'status',
  151. ),
  152. 'status_desc' => array
  153. (
  154. 'type' => 'varchar-300',
  155. 'name' => '支付状态说明',
  156. 'default' => '',
  157. 'desc' => '请输入支付状态说明',
  158. 'match' => 'option',
  159. //'update' => 'textarea',
  160. 'show' => 'status=3',
  161. ),
  162. 'tk_pic' => array
  163. (
  164. 'type' => 'varchar-150',
  165. 'name' => '退款截图',
  166. 'default' => '',
  167. 'desc' => '退款截图',
  168. 'match' => 'is_string',
  169. 'update' => 'image',
  170. 'key' => 1
  171. ),
  172. 'tk_time' => array
  173. (
  174. 'type' => 'int-11',
  175. 'name' => '退款时间',
  176. 'default' => '',
  177. 'desc' => '退款时间',
  178. 'match' => 'option',
  179. //'list' => true,
  180. //'update' => 'date',
  181. 'callback' => 'maketime',
  182. 'show' => 'status=5',
  183. ),
  184. 'tk_admin' => array
  185. (
  186. 'type' => 'int-11',
  187. 'name' => '退款审核人',
  188. 'default' => '1',
  189. 'desc' => '退款审核人',
  190. 'match' => 'option',
  191. //'list' => true,
  192. 'show' => 'status=5',
  193. ),
  194. 'tk_desc' => array
  195. (
  196. 'type' => 'varchar-300',
  197. 'name' => '退款备注',
  198. 'default' => '',
  199. 'desc' => '退款备注',
  200. 'match' => 'option',
  201. 'update' => 'textarea',
  202. //'show' => 'status=5',
  203. ),
  204. 'param' => array
  205. (
  206. 'type' => 'text-255',
  207. 'name' => '支付信息-用于二次支付',
  208. 'default' => '',
  209. 'desc' => '支付信息',
  210. 'match' => 'option',
  211. ),
  212. 'state' => array
  213. (
  214. 'type' => 'tinyint-1',
  215. 'name' => '状态',
  216. 'default' => '1',
  217. 'desc' => '请选择状态',
  218. 'match' => 'is_numeric',
  219. ),
  220. 'cdate' => array
  221. (
  222. 'type' => 'int-11',
  223. 'name' => '申请时间',
  224. 'match' => array('is_numeric', time()),
  225. 'desc' => '',
  226. # 只有insert时才生效
  227. 'insert' => true,
  228. 'search' => 'date',
  229. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  230. ),
  231. ),
  232. 'manage' => array
  233. (
  234. 'insert' => false,
  235. 'edit' => false,
  236. 'delete' => false,
  237. 'excel' => true,
  238. /*
  239. 'list_button' => array(
  240. 'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} > 1'),
  241. ),
  242. */
  243. ),
  244. );