area_entry.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php
  2. $excel = false;
  3. $button = array();
  4. if (Dever::load('manage/auth')->checkFunc('agent.mail.area_entry', 'editareaentry', '数据导出')) {
  5. $excel[] = array('数据导出','数据导出','mail/lib/manage.out_area_entry');
  6. $button['数据导入'] = array('fast', '', 'import&project=upload&call=mail/lib/manage.import');
  7. }
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'area_entry',
  12. # 显示给用户看的名称
  13. 'lang' => '区域分润录入',
  14. 'order' => 79,
  15. 'menu' => 'agent',
  16. 'info' => '点击“数据导出”,下载下来的表格就是“数据导入”的模板,请删除表格里的数据,然后按照表格里的内容填写点击“数据导入”上传即可',
  17. 'end' => array
  18. (
  19. //'insert' => 'mail/lib/manage.updateArea_entry',
  20. ),
  21. # 数据结构
  22. 'struct' => array
  23. (
  24. 'id' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => 'ID',
  28. 'default' => '',
  29. 'desc' => '',
  30. 'match' => 'is_numeric',
  31. 'search' => 'order',
  32. //'list' => true,
  33. ),
  34. 'month' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => '月份',
  38. 'default' => '',
  39. 'match' => 'is_numeric',
  40. 'desc' => '',
  41. 'update' => 'month',
  42. 'search' => 'month_eq',
  43. 'callback' => 'maketime',
  44. 'list' => 'date("Y-m", {month})',
  45. ),
  46. 'shop_id' => array
  47. (
  48. 'type' => 'int-11',
  49. 'name' => '店铺名称/店铺编号',
  50. 'default' => '',
  51. 'desc' => '店铺名称',
  52. 'match' => 'is_numeric',
  53. 'update' => 'select',
  54. 'update_search' => 'shop/lib/manage.search_l_shop',
  55. 'search' => array
  56. (
  57. 'api' => 'shop/info-like',
  58. 'col' => '*',
  59. 'result' => 'id',
  60. ) ,
  61. 'list_name' => '门店信息',
  62. 'list' => 'Dever::load("mail/lib/manage.entry_member", {id})',
  63. 'list_order' => 2,
  64. ),
  65. 'buy' => array
  66. (
  67. 'type' => 'decimal-11,2',
  68. 'name' => '毛利',
  69. 'default' => '0',
  70. 'desc' => '采购金额',
  71. 'match' => 'is_numeric',
  72. 'update' => 'text',
  73. 'list' => true,
  74. 'list_order' => 4,
  75. ),
  76. 'state' => array
  77. (
  78. 'type' => 'tinyint-1',
  79. 'name' => '状态',
  80. 'default' => '1',
  81. 'desc' => '请选择状态',
  82. 'match' => 'is_numeric',
  83. ),
  84. 'cdate' => array
  85. (
  86. 'type' => 'int-11',
  87. 'name' => '统计时间',
  88. 'match' => array('is_numeric', time()),
  89. 'desc' => '',
  90. ),
  91. ),
  92. 'manage' => array
  93. (
  94. // 'insert' => false,
  95. 'delete' => false,
  96. // 'edit' => false,
  97. 'excel' => $excel,
  98. 'button' => $button,
  99. ),
  100. 'request' => array
  101. (
  102. 'getBuy' => array
  103. (
  104. # 匹配的正则或函数 选填项
  105. 'option' => array
  106. (
  107. 'start' => array('yes-month','>='),
  108. 'end' => array('yes-month','<='),
  109. 'shop_id' => array('yes','in'),
  110. 'state' => 1,
  111. ),
  112. 'type' => 'all',
  113. 'col' => '*',
  114. ),
  115. 'getBuyTotal' => array
  116. (
  117. # 匹配的正则或函数 选填项
  118. 'option' => array
  119. (
  120. 'start' => array('yes-month','>='),
  121. 'end' => array('yes-month','<='),
  122. 'shop_id' => 'yes',
  123. 'state' => 1,
  124. ),
  125. 'type' => 'one',
  126. 'col' => 'sum(buy) as total',
  127. ),
  128. ),
  129. );