order.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. 'state' => array
  132. (
  133. 'type' => 'tinyint-1',
  134. 'name' => '状态',
  135. 'default' => '1',
  136. 'desc' => '请选择状态',
  137. 'match' => 'is_numeric',
  138. ),
  139. 'cdate' => array
  140. (
  141. 'type' => 'int-11',
  142. 'name' => '生成时间',
  143. 'match' => array('is_numeric', time()),
  144. 'desc' => '',
  145. # 只有insert时才生效
  146. 'insert' => true,
  147. //'search' => 'date',
  148. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  149. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  150. ),
  151. ),
  152. 'manage' => array
  153. (
  154. 'delete' => false,
  155. 'edit' => false,
  156. 'insert' => false,
  157. 'excel' => $excel,
  158. 'list_button' => array
  159. (
  160. 'oper' => array('全额退款', '"active/lib/manage.refund?id={id}"', '{status} == 2'),
  161. ),
  162. ),
  163. 'request' => array
  164. (
  165. // # 获取数量
  166. 'getNum' => array
  167. (
  168. # 匹配的正则或函数 选填项
  169. 'option' => array
  170. (
  171. 'mid' => 'yes',
  172. 'active_id' => 'yes',
  173. 'status' =>2,
  174. 'state' => 1,
  175. ),
  176. 'type' => 'one',
  177. 'col' => 'sum(num) as total',
  178. ),
  179. 'getAll' => array
  180. (
  181. # 匹配的正则或函数 选填项
  182. 'option' => array
  183. (
  184. 'mid' => 'yes',
  185. 'state' => 1,
  186. ),
  187. 'type' => 'all',
  188. 'order' => array('cdate'=>'desc'),
  189. 'page' => array(20,'list'),
  190. 'col' => '*',
  191. ),
  192. ),
  193. );