journal.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <?php
  2. $journal = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('journal/info')->state(array('buy' => 1));
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. $list = array
  13. (
  14. # 匹配的正则或函数 选填项
  15. 'option' => array
  16. (
  17. 'start_day_int' => array('yes-day_int', '>='),
  18. 'end_day_int' => array('yes-day_int', '<='),
  19. 'journal_id' => 'yes',
  20. 'state' => 1,
  21. ),
  22. 'type' => 'all',
  23. 'order' => array('day_int' => 'desc', 'id' => 'desc'),
  24. 'group' => 'day_int',
  25. 'page' => array(20, 'list'),
  26. 'col' => 'id,sum(order_num) as order_num,sum(order_yes_num) as order_yes_num,sum(order_no_num) as order_no_num,sum(buy_num) as buy_num,sum(buy_cash) as buy_cash,cdate,journal_id,day_int,day_string',
  27. );
  28. $search = Dever::input('search_option_journal_id');
  29. if ($search && $search > 0) {
  30. unset($list['group']);
  31. $list['col'] = '*';
  32. }
  33. return array
  34. (
  35. # 表名
  36. 'name' => 'journal',
  37. # 显示给用户看的名称
  38. 'lang' => '小刊订单',
  39. 'order' => '10',
  40. # 数据结构
  41. 'struct' => array
  42. (
  43. 'id' => array
  44. (
  45. 'type' => 'int-11',
  46. 'name' => 'ID',
  47. 'default' => '',
  48. 'desc' => '',
  49. 'match' => 'is_numeric',
  50. //'list' => true,
  51. ),
  52. 'day_string' => array
  53. (
  54. 'type' => 'varchar-60',
  55. 'name' => '统计日期',
  56. 'default' => '',
  57. 'desc' => '统计日期',
  58. 'match' => 'is_string',
  59. 'update' => 'text',
  60. //'search' => 'fulltext',
  61. 'list' => true,
  62. ),
  63. 'day_int' => array
  64. (
  65. 'type' => 'int-11',
  66. 'name' => '统计日期',
  67. 'default' => '',
  68. 'desc' => '统计日期',
  69. 'match' => 'is_numeric',
  70. 'update' => 'text',
  71. 'search' => 'time',
  72. 'order' => 'desc',
  73. //'list' => true,
  74. ),
  75. 'journal_id' => array
  76. (
  77. 'type' => 'int-11',
  78. 'name' => '小刊',
  79. 'default' => '',
  80. 'desc' => '小刊',
  81. 'match' => 'is_numeric',
  82. 'update' => 'select',
  83. 'search' => 'select',
  84. 'option' => $journal,
  85. 'list' => 'Dever::load("stat/lib/manage.info", {journal_id})',
  86. ),
  87. 'order_num' => array
  88. (
  89. 'type' => 'int-11',
  90. 'name' => '总订单',
  91. 'default' => '0',
  92. 'match' => '总订单数',
  93. 'match' => 'is_numeric',
  94. 'update' => 'text',
  95. 'list' => true,
  96. ),
  97. 'order_yes_num' => array
  98. (
  99. 'type' => 'int-11',
  100. 'name' => '支付订单',
  101. 'default' => '0',
  102. 'match' => '支付订单数',
  103. 'match' => 'is_numeric',
  104. 'update' => 'text',
  105. 'list' => true,
  106. ),
  107. 'order_no_num' => array
  108. (
  109. 'type' => 'int-11',
  110. 'name' => '未支付订单',
  111. 'default' => '0',
  112. 'match' => '未支付订单数',
  113. 'match' => 'is_numeric',
  114. 'update' => 'text',
  115. 'list' => true,
  116. ),
  117. 'buy_num' => array
  118. (
  119. 'type' => 'int-11',
  120. 'name' => '售出本数',
  121. 'default' => '0',
  122. 'match' => '售出本数',
  123. 'match' => 'is_numeric',
  124. 'update' => 'text',
  125. 'list' => true,
  126. ),
  127. 'buy_cash' => array
  128. (
  129. 'type' => 'int-11',
  130. 'name' => '售出金额',
  131. 'default' => '0',
  132. 'match' => '售出金额',
  133. 'match' => 'is_numeric',
  134. 'update' => 'text',
  135. 'list' => true,
  136. ),
  137. 'state' => array
  138. (
  139. 'type' => 'tinyint-1',
  140. 'name' => '状态',
  141. 'default' => '1',
  142. 'desc' => '请选择状态',
  143. 'match' => 'is_numeric',
  144. ),
  145. 'cdate' => array
  146. (
  147. 'type' => 'int-11',
  148. 'name' => '上次统计时间',
  149. 'match' => array('is_numeric', time()),
  150. 'desc' => '',
  151. # 只有insert时才生效
  152. 'insert' => true,
  153. //'search' => 'date',
  154. 'list' => 'date("Y-m-d H:i", {cdate})',
  155. ),
  156. ),
  157. 'manage' => array
  158. (
  159. 'insert' => false,
  160. 'edit' => false,
  161. 'delete' => false,
  162. 'num' => false,
  163. 'excel' => true,
  164. //'page_list' => 'journal',
  165. ),
  166. 'request' => array
  167. (
  168. 'list' => $list,
  169. 'getData' => array
  170. (
  171. # 匹配的正则或函数 选填项
  172. 'option' => array
  173. (
  174. 'start' => array('yes-day_int', '>='),
  175. 'end' => array('yes-day_int', '<='),
  176. 'state' => 1,
  177. ),
  178. 'type' => 'all',
  179. 'order' => array('day_int' => 'desc'),
  180. //'group' => 'day_int',
  181. 'col' => '*',
  182. ),
  183. ),
  184. );