order.php 5.4 KB

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