shop.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <?php
  2. $status = array
  3. (
  4. 1 => '未对账',
  5. 2 => '已对账',
  6. );
  7. $type = array
  8. (
  9. 1 => '按月对账',
  10. 2 => '按周对账',
  11. 3 => '按天对账',
  12. );
  13. $shop = function()
  14. {
  15. $array = array();
  16. $info = Dever::db('shop/info')->state();
  17. if($info)
  18. {
  19. $array += $info;
  20. }
  21. return $array;
  22. };
  23. $mul = false;
  24. $mul = '{status} == 1';
  25. return array
  26. (
  27. # 表名
  28. 'name' => 'shop',
  29. # 显示给用户看的名称
  30. 'lang' => '门店对账单',
  31. 'order' => 90,
  32. 'config_status' => $status,
  33. 'config_type' => $type,
  34. 'updatemul' => 'cash/lib/set.auditShopMul',
  35. # 数据结构
  36. 'struct' => array
  37. (
  38. 'id' => array
  39. (
  40. 'type' => 'int-11',
  41. 'name' => 'ID',
  42. 'default' => '',
  43. 'desc' => '',
  44. 'match' => 'is_numeric',
  45. 'search' => 'order',
  46. //'list' => true,
  47. ),
  48. 'type' => array
  49. (
  50. 'type' => 'tinyint-1',
  51. 'name' => '对账单类型',
  52. 'default' => '1',
  53. 'desc' => '对账单类型',
  54. 'match' => 'is_numeric',
  55. ),
  56. 'day' => array
  57. (
  58. 'type' => 'int-11',
  59. 'name' => '对账单时间',
  60. 'default' => '',
  61. 'match' => 'is_numeric',
  62. 'desc' => '',
  63. 'search' => 'day',
  64. 'order' => 'desc',
  65. 'list' => 'Dever::load("cash/lib/set.statDate", "{type}", "{day}")',
  66. ),
  67. 'shop_id' => array
  68. (
  69. 'type' => 'int-11',
  70. 'name' => '对账门店',
  71. 'default' => '',
  72. 'desc' => '对账门店',
  73. 'match' => 'is_numeric',
  74. 'search' => 'select',
  75. 'option' => $shop,
  76. 'update' => 'hidden',
  77. 'value' => Dever::input('search_option_shop_id'),
  78. 'list' => 'Dever::load("shop/info-one#name", {shop_id})',
  79. ),
  80. 'start' => array
  81. (
  82. 'type' => 'int-11',
  83. 'name' => '对账单开始时间',
  84. 'default' => '',
  85. 'match' => 'is_numeric',
  86. 'desc' => '',
  87. ),
  88. 'end' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '对账单结束时间',
  92. 'default' => '',
  93. 'match' => 'is_numeric',
  94. 'desc' => '',
  95. 'list_name' => '对账周期',
  96. 'list' => 'Dever::load("cash/lib/set.statTime", "{start}", "{end}")',
  97. ),
  98. 'cash' => array
  99. (
  100. 'type' => 'varchar-100',
  101. 'name' => '对账金额',
  102. 'default' => '0',
  103. 'desc' => '对账金额',
  104. 'match' => 'option',
  105. 'update' => 'text',
  106. 'list' => 'Dever::load("cash/lib/set.getCash", "{cash}")',
  107. ),
  108. 'num' => array
  109. (
  110. 'type' => 'varchar-100',
  111. 'name' => '对账数量',
  112. 'default' => '0',
  113. 'desc' => '对账数量',
  114. 'match' => 'option',
  115. 'update' => 'text',
  116. //'list' => true,
  117. ),
  118. 'shop_status' => array
  119. (
  120. 'type' => 'int-11',
  121. 'name' => '门店对账状态',
  122. 'default' => '1',
  123. 'desc' => '门店对账状态',
  124. 'match' => 'is_numeric',
  125. 'update' => 'radio',
  126. 'search' => 'select',
  127. 'option' => $status,
  128. 'list' => true,
  129. ),
  130. 'status' => array
  131. (
  132. 'type' => 'int-11',
  133. 'name' => '平台对账状态',
  134. 'default' => '1',
  135. 'desc' => '平台对账状态',
  136. 'match' => 'is_numeric',
  137. 'update' => 'radio',
  138. 'search' => 'select',
  139. 'option' => $status,
  140. 'list' => true,
  141. 'mul' => array('2' => '已对账'),
  142. ),
  143. 'state' => array
  144. (
  145. 'type' => 'tinyint-1',
  146. 'name' => '状态',
  147. 'default' => '1',
  148. 'desc' => '请选择状态',
  149. 'match' => 'is_numeric',
  150. ),
  151. 'cdate' => array
  152. (
  153. 'type' => 'int-11',
  154. 'name' => '生成时间',
  155. 'match' => array('is_numeric', time()),
  156. 'desc' => '',
  157. # 只有insert时才生效
  158. 'insert' => true,
  159. //'search' => 'date',
  160. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  161. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  162. ),
  163. ),
  164. 'manage' => array
  165. (
  166. 'delete' => false,
  167. 'edit' => false,
  168. 'insert' => false,
  169. 'excel' => true,
  170. 'mul' => $mul,
  171. 'list_button' => array(
  172. 'list' => array('查看详情', '"order&project=cash&id={id}&page_type=1&type=shop"'),
  173. 'oper' => array('确认对账金额', '"cash/lib/set.audit?id={id}&type=shop"', '{status} == 1', 'Dever::load("cash/lib/set.statYes", "{id}", "shop")', '请确认'),
  174. ),
  175. ),
  176. 'request' => array
  177. (
  178. # 获取总金额
  179. 'getAll' => array
  180. (
  181. # 匹配的正则或函数 选填项
  182. 'option' => array
  183. (
  184. 'start' => array('yes-day', '>='),
  185. 'end' => array('yes-day', '<='),
  186. 'shop_id' => 'yes',
  187. 'status' => 'yes',
  188. 'state' => 1,
  189. ),
  190. 'type' => 'all',
  191. 'order' => array('day'=>'desc','id' => 'desc'),
  192. 'page' => array(10, 'list'),
  193. 'col' => '*',
  194. ),
  195. # 获取总金额
  196. 'getData' => array
  197. (
  198. # 匹配的正则或函数 选填项
  199. 'option' => array
  200. (
  201. 'start' => array('yes-day', '>='),
  202. 'end' => array('yes-day', '<='),
  203. 'shop_id' => array('yes', 'in'),
  204. 'status' => 'yes',
  205. 'state' => 1,
  206. ),
  207. 'type' => 'all',
  208. 'order' => array('day'=>'desc','id' => 'desc'),
  209. 'col' => '*',
  210. ),
  211. ),
  212. );