order.php 5.4 KB

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