journal.php 5.9 KB

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