store.php 5.7 KB

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