area_entry.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. 'end' => array
  17. (
  18. //'insert' => 'mail/lib/manage.updateArea_entry',
  19. ),
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => 'ID',
  27. 'default' => '',
  28. 'desc' => '',
  29. 'match' => 'is_numeric',
  30. 'search' => 'order',
  31. //'list' => true,
  32. ),
  33. 'month' => array
  34. (
  35. 'type' => 'int-11',
  36. 'name' => '月份',
  37. 'default' => '',
  38. 'match' => 'is_numeric',
  39. 'desc' => '',
  40. 'update' => 'month',
  41. 'search' => 'month_eq',
  42. 'callback' => 'maketime',
  43. 'list' => 'date("Y-m", {month})',
  44. ),
  45. 'shop_id' => array
  46. (
  47. 'type' => 'int-11',
  48. 'name' => '店铺名称/店铺编号',
  49. 'default' => '',
  50. 'desc' => '店铺名称',
  51. 'match' => 'is_numeric',
  52. 'update' => 'select',
  53. 'update_search' => 'shop/lib/manage.search_l_shop',
  54. 'search' => array
  55. (
  56. 'api' => 'shop/info-like',
  57. 'col' => '*',
  58. 'result' => 'id',
  59. ) ,
  60. 'list_name' => '门店信息',
  61. 'list' => 'Dever::load("mail/lib/manage.entry_member", {id})',
  62. 'list_order' => 2,
  63. ),
  64. 'buy' => array
  65. (
  66. 'type' => 'decimal-11,2',
  67. 'name' => '毛利',
  68. 'default' => '0',
  69. 'desc' => '采购金额',
  70. 'match' => 'is_numeric',
  71. 'update' => 'text',
  72. 'list' => true,
  73. 'list_order' => 4,
  74. ),
  75. 'state' => array
  76. (
  77. 'type' => 'tinyint-1',
  78. 'name' => '状态',
  79. 'default' => '1',
  80. 'desc' => '请选择状态',
  81. 'match' => 'is_numeric',
  82. ),
  83. 'cdate' => array
  84. (
  85. 'type' => 'int-11',
  86. 'name' => '统计时间',
  87. 'match' => array('is_numeric', time()),
  88. 'desc' => '',
  89. ),
  90. ),
  91. 'manage' => array
  92. (
  93. // 'insert' => false,
  94. 'delete' => false,
  95. // 'edit' => false,
  96. 'excel' => $excel,
  97. 'button' => $button,
  98. ),
  99. 'request' => array
  100. (
  101. 'getBuy' => array
  102. (
  103. # 匹配的正则或函数 选填项
  104. 'option' => array
  105. (
  106. 'start' => array('yes-month','>='),
  107. 'end' => array('yes-month','<='),
  108. 'shop_id' => array('yes','in'),
  109. 'state' => 1,
  110. ),
  111. 'type' => 'all',
  112. 'col' => '*',
  113. ),
  114. 'getBuyTotal' => array
  115. (
  116. # 匹配的正则或函数 选填项
  117. 'option' => array
  118. (
  119. 'start' => array('yes-month','>='),
  120. 'end' => array('yes-month','<='),
  121. 'shop_id' => 'yes',
  122. 'state' => 1,
  123. ),
  124. 'type' => 'one',
  125. 'col' => 'sum(buy) as total',
  126. ),
  127. ),
  128. );