seller.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <?php
  2. # 获取电子刊分类权限
  3. $auth = Dever::tops();
  4. # 如果用linkage,那么下面这两个用不上了
  5. $journal = function() use ($auth)
  6. {
  7. $array = array();
  8. if ($auth) {
  9. $info = Dever::db('journal/info')->getIds(array('cate_id' => $auth, 'buy' => 1));
  10. } else {
  11. $info = Dever::db('journal/info')->state(array('buy' => 1));
  12. }
  13. if($info)
  14. {
  15. $array += $info;
  16. }
  17. return $array;
  18. };
  19. $cate = function() use ($auth)
  20. {
  21. $array = array();
  22. if ($auth) {
  23. $info = Dever::db('journal/cate')->getIds(array('ids' => $auth));
  24. } else {
  25. $info = Dever::db('journal/cate')->state();
  26. }
  27. if($info)
  28. {
  29. $array += $info;
  30. }
  31. return $array;
  32. };
  33. $seller = function()
  34. {
  35. $array = array();
  36. $info = Dever::db('code/seller')->state();
  37. if($info)
  38. {
  39. $array += $info;
  40. }
  41. return $array;
  42. };
  43. $zhou = Dever::input('search_zhou');
  44. if ($zhou) {
  45. $group = 'seller_id,cate_id';
  46. } else {
  47. $group = 'day_int,seller_id,cate_id';
  48. }
  49. $list = array
  50. (
  51. # 匹配的正则或函数 选填项
  52. 'option' => array
  53. (
  54. 'start_day_int' => array('yes-day_int', '>='),
  55. 'end_day_int' => array('yes-day_int', '<='),
  56. 'seller_id' => 'yes',
  57. 'cate_id' => 'yes',
  58. 'journal_id' => 'yes',
  59. 'state' => 1,
  60. ),
  61. 'type' => 'all',
  62. 'order' => array('day_int' => 'desc', 'id' => 'desc'),
  63. 'group' => $group,
  64. 'page' => array(20, 'list'),
  65. 'col' => 'id,sum(code_num) as code_num,sum(code_yes_num) as code_yes_num,sum(code_no_num) as code_no_num,sum(code_drop_num) as code_drop_num,cdate,journal_id,seller_id,day_int,day_string,cate_id',
  66. );
  67. //$search = Dever::input('search_option_journal_id');
  68. $search = Dever::input('search_linkage_cate_journal');
  69. if ($search && $search != -1 && isset($search[1]) && $search[1] > 0) {
  70. $list['option']['journal_id'] = $search[1];
  71. Dever::setInput('search_option_journal_id', $search[1]);
  72. }
  73. if (!$zhou) {
  74. unset($list['group']);
  75. $list['col'] = 'id,code_num,code_yes_num,code_no_num,code_drop_num,cdate,journal_id,seller_id,day_int,day_string,cate_id';
  76. }
  77. if ($auth) {
  78. $list['option']['cate_id'] = array($auth, 'in');
  79. }
  80. $config = array
  81. (
  82. # 表名
  83. 'name' => 'seller',
  84. # 显示给用户看的名称
  85. 'lang' => '销售商订单统计',
  86. 'order' => '8',
  87. 'menu' => false,
  88. # 数据结构
  89. 'struct' => array
  90. (
  91. 'id' => array
  92. (
  93. 'type' => 'int-11',
  94. 'name' => 'ID',
  95. 'default' => '',
  96. 'desc' => '',
  97. 'match' => 'is_numeric',
  98. //'list' => true,
  99. ),
  100. 'day_string' => array
  101. (
  102. 'type' => 'varchar-60',
  103. 'name' => '统计日期',
  104. 'default' => '',
  105. 'desc' => '统计日期',
  106. 'match' => 'is_string',
  107. 'update' => 'text',
  108. //'search' => 'fulltext',
  109. 'list' => $zhou ? false : true,
  110. ),
  111. 'day_int' => array
  112. (
  113. 'type' => 'int-11',
  114. 'name' => '统计日期',
  115. 'default' => '',
  116. 'desc' => '统计日期',
  117. 'match' => 'is_numeric',
  118. 'update' => 'text',
  119. 'search' => 'time',
  120. 'order' => 'desc',
  121. //'list' => true,
  122. ),
  123. 'seller_id' => array
  124. (
  125. 'type' => 'int-11',
  126. 'name' => '销售商',
  127. 'default' => '',
  128. 'desc' => '销售商',
  129. 'match' => 'is_numeric',
  130. 'update' => 'select',
  131. 'search' => 'select',
  132. 'option' => $seller,
  133. 'list' => true,
  134. ),
  135. 'cate_journal' => array
  136. (
  137. 'name' => '电子刊',
  138. 'default' => '',
  139. 'desc' => '电子刊',
  140. 'search' => 'linkage',
  141. 'search_col' => 'cate_id,product_id',
  142. 'option' => Dever::url('lib/manage.search_cate_journal', 'journal'),
  143. ),
  144. 'cate_id' => array
  145. (
  146. 'type' => 'int-11',
  147. 'name' => '电子刊分类',
  148. 'default' => '1',
  149. 'desc' => '电子刊分类',
  150. 'match' => 'is_numeric',
  151. 'update' => 'select',
  152. 'option' => $cate,
  153. //'search' => 'select',
  154. 'list' => true,
  155. ),
  156. 'journal_id' => array
  157. (
  158. 'type' => 'int-11',
  159. 'name' => '电子刊',
  160. 'default' => '',
  161. 'desc' => '电子刊',
  162. 'match' => 'is_numeric',
  163. 'update' => 'select',
  164. //'search' => 'select',
  165. 'option' => $journal,
  166. 'list' => $zhou ? false : 'Dever::load("stat/lib/manage.info", {journal_id}, true)',
  167. ),
  168. 'code_num' => array
  169. (
  170. 'type' => 'int-11',
  171. 'name' => '兑换码总数量',
  172. 'default' => '0',
  173. 'match' => '兑换码总数量',
  174. 'match' => 'is_numeric',
  175. 'update' => 'text',
  176. //'list' => true,
  177. ),
  178. 'code_yes_num' => array
  179. (
  180. 'type' => 'int-11',
  181. 'name' => '兑换码已用数',
  182. 'default' => '0',
  183. 'match' => '兑换码已用数',
  184. 'match' => 'is_numeric',
  185. 'update' => 'text',
  186. 'list' => true,
  187. ),
  188. 'code_no_num' => array
  189. (
  190. 'type' => 'int-11',
  191. 'name' => '兑换码未用数',
  192. 'default' => '0',
  193. 'match' => '兑换码未用数',
  194. 'match' => 'is_numeric',
  195. 'update' => 'text',
  196. 'list' => true,
  197. ),
  198. 'code_drop_num' => array
  199. (
  200. 'type' => 'int-11',
  201. 'name' => '兑换码作废数',
  202. 'default' => '0',
  203. 'match' => '兑换码作废数',
  204. 'match' => 'is_numeric',
  205. 'update' => 'text',
  206. 'list' => true,
  207. ),
  208. 'state' => array
  209. (
  210. 'type' => 'tinyint-1',
  211. 'name' => '状态',
  212. 'default' => '1',
  213. 'desc' => '请选择状态',
  214. 'match' => 'is_numeric',
  215. ),
  216. 'cdate' => array
  217. (
  218. 'type' => 'int-11',
  219. 'name' => '上次统计时间',
  220. 'match' => array('is_numeric', time()),
  221. 'desc' => '',
  222. # 只有insert时才生效
  223. 'insert' => true,
  224. //'search' => 'date',
  225. 'list' => 'date("Y-m-d H:i", {cdate})',
  226. ),
  227. ),
  228. 'top' => Dever::config('base')->top,
  229. 'manage' => array
  230. (
  231. 'insert' => false,
  232. 'edit' => false,
  233. 'delete' => false,
  234. 'num' => false,
  235. 'excel' => true,
  236. //'page_list' => 'journal',
  237. ),
  238. 'request' => array
  239. (
  240. 'list' => $list,
  241. 'getData' => array
  242. (
  243. # 匹配的正则或函数 选填项
  244. 'option' => array
  245. (
  246. 'start' => array('yes-day_int', '>='),
  247. 'end' => array('yes-day_int', '<='),
  248. 'state' => 1,
  249. ),
  250. 'type' => 'all',
  251. 'order' => array('day_int' => 'desc'),
  252. //'group' => 'day_int',
  253. 'col' => '*',
  254. ),
  255. ),
  256. );
  257. if ($search && $search > 0) {
  258. }
  259. return $config;