pay.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <?php
  2. $config = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('account/config')->state();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. $project = function()
  13. {
  14. $array = array();
  15. $data = Dever::load('account/config_project-state');
  16. if($data)
  17. {
  18. $array += $data;
  19. }
  20. return $array;
  21. };
  22. if (Dever::project('pay')) {
  23. $status = Dever::config('base', 'pay')->pay['status'];
  24. } else {
  25. $status = array();
  26. }
  27. return array
  28. (
  29. # 表名
  30. 'name' => 'pay',
  31. # 显示给用户看的名称
  32. 'lang' => '充值订单',
  33. 'order' => 30,
  34. 'menu' => false,
  35. # 数据结构
  36. 'struct' => array
  37. (
  38. 'id' => array
  39. (
  40. 'type' => 'int-11',
  41. 'name' => 'ID',
  42. 'default' => '',
  43. 'desc' => '',
  44. 'match' => 'is_numeric',
  45. 'search' => 'order',
  46. 'list' => true,
  47. ),
  48. 'order_num' => array
  49. (
  50. 'type' => 'varchar-100',
  51. 'name' => '订单号',
  52. 'default' => '',
  53. 'desc' => '订单号',
  54. 'match' => 'is_string',
  55. 'search' => 'fulltext',
  56. 'list' => true,
  57. ),
  58. 'config_id' => array
  59. (
  60. 'type' => 'int-11',
  61. 'name' => '账户名称',
  62. 'default' => '1',
  63. 'desc' => '账户名称',
  64. 'match' => 'is_numeric',
  65. 'update' => 'select',
  66. 'option' => $config,
  67. //'search' => 'select',
  68. 'list' => true,
  69. ),
  70. 'info_id' => array
  71. (
  72. 'type' => 'int-11',
  73. 'name' => '账户id',
  74. 'default' => '',
  75. 'desc' => '账户id',
  76. 'match' => 'is_numeric',
  77. ),
  78. 'card_id' => array
  79. (
  80. 'type' => 'int-11',
  81. 'name' => '充值卡',
  82. 'default' => '',
  83. 'desc' => '充值卡',
  84. 'match' => 'is_numeric',
  85. 'list' => '"{card_id}" ? Dever::load("account/config_card-find#name", {card_id}) : "-"',
  86. ),
  87. 'uid' => array
  88. (
  89. 'type' => 'int-11',
  90. 'name' => '购买人-输入用户手机号或者用户名',
  91. 'default' => '',
  92. 'desc' => '购买人',
  93. 'match' => 'is_numeric',
  94. 'search' => array
  95. (
  96. 'api' => 'user/info-like',
  97. 'col' => 'search',
  98. 'result' => 'id',
  99. ),
  100. 'update' => 'select',
  101. 'update_search' => 'user/lib/info.manage_search',
  102. 'list' => '"{uid}" ? Dever::load("user/lib/info.get#aname", {uid}) : "暂无"',
  103. ),
  104. 'name' => array
  105. (
  106. 'type' => 'varchar-800',
  107. 'name' => '充值信息',
  108. 'default' => '',
  109. 'desc' => '充值信息',
  110. 'match' => 'is_string',
  111. 'update' => 'text',
  112. 'search' => 'fulltext',
  113. 'list' => true,
  114. ),
  115. 'cash' => array
  116. (
  117. 'type' => 'decimal-11,2',
  118. 'name' => '充值金额',
  119. 'default' => '',
  120. 'desc' => '充值金额',
  121. 'match' => 'option',
  122. //'update' => 'text',
  123. 'list' => true,
  124. ),
  125. 'price' => array
  126. (
  127. 'type' => 'decimal-11,2',
  128. 'name' => '实付金额',
  129. 'default' => '',
  130. 'desc' => '实付金额',
  131. 'match' => 'option',
  132. //'update' => 'text',
  133. 'list' => true,
  134. ),
  135. 'yue' => array
  136. (
  137. 'type' => 'decimal-11,2',
  138. 'name' => '充值后余额',
  139. 'default' => '',
  140. 'desc' => '充值后余额',
  141. 'match' => 'option',
  142. //'update' => 'text',
  143. 'list' => true,
  144. ),
  145. 'status' => array
  146. (
  147. 'type' => 'tinyint-1',
  148. 'name' => '订单状态',
  149. 'default' => '1',
  150. 'desc' => '订单状态',
  151. 'match' => 'is_numeric',
  152. 'option' => $status,
  153. 'search' => 'select',
  154. 'list' => true,
  155. ),
  156. 'state' => array
  157. (
  158. 'type' => 'tinyint-1',
  159. 'name' => '状态',
  160. 'default' => '1',
  161. 'desc' => '请选择状态',
  162. 'match' => 'is_numeric',
  163. ),
  164. 'cdate' => array
  165. (
  166. 'type' => 'int-11',
  167. 'name' => '下单时间',
  168. 'match' => array('is_numeric', time()),
  169. 'desc' => '',
  170. # 只有insert时才生效
  171. 'insert' => true,
  172. 'search' => 'sdate',
  173. 'list' => 'date("Y-m-d H:i", {cdate})',
  174. ),
  175. ),
  176. 'manage' => array
  177. (
  178. 'delete' => false,
  179. 'edit' => false,
  180. 'insert' => false,
  181. ),
  182. 'request' => array
  183. (
  184. 'getCash' => array
  185. (
  186. # 匹配的正则或函数 选填项
  187. 'option' => array
  188. (
  189. 'uid' => 'yes',
  190. 'config_id' => 'yes',
  191. 'status' => 'yes',
  192. 'state' => 1,
  193. ),
  194. 'type' => 'one',
  195. 'col' => 'sum(price) as price, sum(cash) as cash',
  196. ),
  197. ),
  198. );