order.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <?php
  2. $excel = false;
  3. $excel[] = array('数据导出','数据导出','active/lib/excel.out_active_order');
  4. $pay_type = array
  5. (
  6. 1 => '在线支付',
  7. );
  8. $status = array
  9. (
  10. 1 => '待支付',
  11. 2 => '已支付',
  12. 3 => '已关闭',#超时未支付
  13. 4 => '已完成',
  14. 5 => '已完成(有退款)',
  15. 6 => '已退款',#(全部退款)
  16. );
  17. $active = function()
  18. {
  19. $array = array();
  20. $info = Dever::load('active/info-state');
  21. if($info)
  22. {
  23. $array += $info;
  24. }
  25. return $array;
  26. };
  27. return array
  28. (
  29. # 表名
  30. 'name' => 'order',
  31. # 显示给用户看的名称
  32. 'lang' => '活动订单',
  33. 'order' => 100,
  34. 'config_status' => $status,
  35. 'config_pay_type' => $pay_type,
  36. # 数据结构
  37. 'struct' => array
  38. (
  39. 'id' => array
  40. (
  41. 'type' => 'int-11',
  42. 'name' => 'ID',
  43. 'default' => '',
  44. 'desc' => '',
  45. 'match' => 'is_numeric',
  46. 'search' => 'order',
  47. // 'list' => true,
  48. ),
  49. 'order_num' => array
  50. (
  51. 'type' => 'varchar-100',
  52. 'name' => '订单单号',
  53. 'default' => '',
  54. 'desc' => '订单单号',
  55. 'match' => 'is_string',
  56. 'update' => 'text',
  57. 'search' => 'fulltext',
  58. 'list' => true,
  59. ),
  60. 'mid' => array
  61. (
  62. 'type' => 'int-11',
  63. 'name' => '代理商姓名/手机号',
  64. 'default' => '-1',
  65. 'desc' => '代理商',
  66. 'match' => 'is_string',
  67. 'update' => 'text',
  68. 'search' => array
  69. (
  70. 'api' => 'agent/member-getSearch',
  71. 'col' => 'col',
  72. 'result' => 'id',
  73. 'search' => 'mid',
  74. ),
  75. 'list_name' => '代理商信息',
  76. 'list' => 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true)',
  77. ),
  78. 'active_id' => array
  79. (
  80. 'type' => 'int-11',
  81. 'name' => '活动名称',
  82. 'default' => '-1',
  83. 'desc' => '活动名称',
  84. 'match' => 'is_string',
  85. 'option' => $active,
  86. 'update' => 'text',
  87. // 'search' => 'text',
  88. 'list' => true,
  89. ),
  90. 'num' => array
  91. (
  92. 'type' => 'varchar-100',
  93. 'name' => '数量',
  94. 'default' => '',
  95. 'desc' => '数量',
  96. 'match' => 'option',
  97. 'list' => true,
  98. ),
  99. 'price' => array
  100. (
  101. 'type' => 'varchar-50',
  102. 'name' => '金额',
  103. 'default' => '0',
  104. 'desc' => '金额',
  105. 'match' => 'option',
  106. 'update' => 'text',
  107. 'list' => true,
  108. ),
  109. 'status' => array
  110. (
  111. 'type' => 'tinyint-1',
  112. 'name' => '支付状态',
  113. 'default' => '1',
  114. 'desc' => '支付状态',
  115. 'match' => 'is_numeric',
  116. 'option' => $status,
  117. 'search' => 'select',
  118. 'list' => true,
  119. ),
  120. 'pay_type' => array
  121. (
  122. 'type' => 'tinyint-1',
  123. 'name' => '支付类型',
  124. 'default' => '1',
  125. 'desc' => '支付类型',
  126. 'match' => 'is_numeric',
  127. 'option' => $pay_type,
  128. 'search' => 'select',
  129. 'list' => true,
  130. ),
  131. 'remark' => array
  132. (
  133. 'type' => 'varchar-300',
  134. 'name' => '订单备注',
  135. 'default' => '',
  136. 'desc' => '订单备注',
  137. 'match' => 'option',
  138. 'update' => 'textarea',
  139. ),
  140. 'url' => array
  141. (
  142. 'type' => 'varchar-3000',
  143. 'name' => '支付链接',
  144. 'default' => '',
  145. 'desc' => '支付链接',
  146. 'match' => 'is_string',
  147. // 'update' => 'fulltext',
  148. //'search' => 'fulltext',
  149. //'list' => true,
  150. ),
  151. 'state' => array
  152. (
  153. 'type' => 'tinyint-1',
  154. 'name' => '状态',
  155. 'default' => '1',
  156. 'desc' => '请选择状态',
  157. 'match' => 'is_numeric',
  158. ),
  159. 'cdate' => array
  160. (
  161. 'type' => 'int-11',
  162. 'name' => '生成时间',
  163. 'match' => array('is_numeric', time()),
  164. 'desc' => '',
  165. # 只有insert时才生效
  166. 'insert' => true,
  167. //'search' => 'date',
  168. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  169. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  170. ),
  171. ),
  172. 'manage' => array
  173. (
  174. 'delete' => false,
  175. 'edit' => false,
  176. 'insert' => false,
  177. 'excel' => $excel,
  178. 'list_button' => array
  179. (
  180. 'oper' => array('全额退款', '"active/lib/manage.refund?id={id}"', '{status} == 2'),
  181. ),
  182. ),
  183. 'request' => array
  184. (
  185. // # 获取数量
  186. 'getNum' => array
  187. (
  188. # 匹配的正则或函数 选填项
  189. 'option' => array
  190. (
  191. 'mid' => 'yes',
  192. 'active_id' => 'yes',
  193. 'status' =>2,
  194. 'state' => 1,
  195. ),
  196. 'type' => 'one',
  197. 'col' => 'sum(num) as total',
  198. ),
  199. 'getAll' => array
  200. (
  201. # 匹配的正则或函数 选填项
  202. 'option' => array
  203. (
  204. 'mid' => 'yes',
  205. 'status' => array('yes','!='),
  206. 'state' => 1,
  207. ),
  208. 'type' => 'all',
  209. 'order' => array('cdate'=>'desc'),
  210. 'page' => array(20,'list'),
  211. 'col' => '*',
  212. ),
  213. ),
  214. );