order.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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-200',
  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. 'refund_cash' => array
  140. (
  141. 'type' => 'varchar-11',
  142. 'name' => '退款金额',
  143. 'default' => '',
  144. 'desc' => '退款金额',
  145. 'match' => 'is_string',
  146. 'update' => 'text',
  147. 'list' => true,
  148. ),
  149. 'status' => array
  150. (
  151. 'type' => 'tinyint-1',
  152. 'name' => '支付状态',
  153. 'default' => '1',
  154. 'desc' => '支付状态',
  155. 'match' => 'is_numeric',
  156. 'update' => 'radio',
  157. 'option' => $status,
  158. 'search' => 'select',
  159. 'list' => 'Dever::load("pay/lib/manage.showOrderStatus", "{id}")',
  160. 'control' => 'status',
  161. ),
  162. 'status_desc' => array
  163. (
  164. 'type' => 'varchar-300',
  165. 'name' => '支付状态说明',
  166. 'default' => '',
  167. 'desc' => '请输入支付状态说明',
  168. 'match' => 'option',
  169. //'update' => 'textarea',
  170. 'show' => 'status=3',
  171. ),
  172. 'tk_pic' => array
  173. (
  174. 'type' => 'varchar-150',
  175. 'name' => '退款截图',
  176. 'default' => '',
  177. 'desc' => '退款截图',
  178. 'match' => 'is_string',
  179. 'update' => 'image',
  180. 'key' => 1
  181. ),
  182. 'tk_time' => array
  183. (
  184. 'type' => 'int-11',
  185. 'name' => '退款时间',
  186. 'default' => '',
  187. 'desc' => '退款时间',
  188. 'match' => 'option',
  189. //'list' => true,
  190. //'update' => 'date',
  191. 'callback' => 'maketime',
  192. 'show' => 'status=5',
  193. ),
  194. 'tk_admin' => array
  195. (
  196. 'type' => 'int-11',
  197. 'name' => '退款审核人',
  198. 'default' => '1',
  199. 'desc' => '退款审核人',
  200. 'match' => 'option',
  201. //'list' => true,
  202. 'show' => 'status=5',
  203. ),
  204. 'tk_desc' => array
  205. (
  206. 'type' => 'varchar-300',
  207. 'name' => '退款备注',
  208. 'default' => '',
  209. 'desc' => '退款备注',
  210. 'match' => 'option',
  211. 'update' => 'textarea',
  212. //'show' => 'status=5',
  213. ),
  214. 'param' => array
  215. (
  216. 'type' => 'text-255',
  217. 'name' => '支付信息-用于二次支付',
  218. 'default' => '',
  219. 'desc' => '支付信息',
  220. 'match' => 'option',
  221. ),
  222. 'state' => array
  223. (
  224. 'type' => 'tinyint-1',
  225. 'name' => '状态',
  226. 'default' => '1',
  227. 'desc' => '请选择状态',
  228. 'match' => 'is_numeric',
  229. ),
  230. 'pay_time' => array
  231. (
  232. 'type' => 'int-11',
  233. 'name' => '付款时间',
  234. 'default' => '',
  235. 'desc' => '付款时间',
  236. 'match' => 'option',
  237. //'list' => true,
  238. //'update' => 'date',
  239. 'callback' => 'maketime',
  240. ),
  241. 'cdate' => array
  242. (
  243. 'type' => 'int-11',
  244. 'name' => '申请时间',
  245. 'match' => array('is_numeric', time()),
  246. 'desc' => '',
  247. # 只有insert时才生效
  248. 'insert' => true,
  249. 'search' => 'date',
  250. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  251. ),
  252. ),
  253. 'manage' => array
  254. (
  255. 'insert' => false,
  256. 'edit' => false,
  257. 'delete' => false,
  258. 'excel' => true,
  259. /*
  260. 'list_button' => array(
  261. 'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} > 1'),
  262. ),
  263. */
  264. ),
  265. );