dh_order_goods.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <?php
  2. $status = array
  3. (
  4. 1 => '正常',
  5. 2 => '申请退款中',
  6. 3 => '已取消',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'dh_order_goods',
  12. # 显示给用户看的名称
  13. 'lang' => '订单商品表',
  14. 'menu' => false,
  15. 'status' => $status,
  16. # 数据结构
  17. 'struct' => array
  18. (
  19. 'id' => array
  20. (
  21. 'type' => 'int-11',
  22. 'name' => 'ID',
  23. 'default' => '',
  24. 'desc' => '',
  25. 'match' => 'is_numeric',
  26. 'search' => 'order',
  27. 'update' => 'hidden',
  28. //'list' => true,
  29. ),
  30. 'order_id' => array
  31. (
  32. 'type' => 'int-11',
  33. 'name' => '订单表id',
  34. 'default' => '',
  35. 'desc' => '订单表id',
  36. 'match' => 'is_numeric',
  37. ),
  38. 'shop_id' => array
  39. (
  40. 'type' => 'int-11',
  41. 'name' => '门店名称',
  42. 'default' => '',
  43. 'desc' => '门店名称',
  44. 'match' => 'is_numeric',
  45. ),
  46. 'shop_id' => array
  47. (
  48. 'type' => 'int-11',
  49. 'name' => '门店名称',
  50. 'default' => '',
  51. 'desc' => '门店名称',
  52. 'match' => 'is_numeric',
  53. ),
  54. 'goods_id' => array
  55. (
  56. 'type' => 'int-11',
  57. 'name' => '商品名称',
  58. 'default' => '',
  59. 'desc' => '商品名称',
  60. 'match' => 'is_numeric',
  61. 'list' => 'Dever::load("goods/info-find#name", {goods_id})',
  62. ),
  63. 'sku_id' => array
  64. (
  65. 'type' => 'int-11',
  66. 'name' => 'sku_id',
  67. 'default' => '-1',
  68. 'desc' => 'sku_id',
  69. 'match' => 'is_numeric',
  70. ),
  71. 'price' => array
  72. (
  73. 'type' => 'varchar-50',
  74. 'name' => '单价',
  75. 'default' => '',
  76. 'desc' => '单价',
  77. 'match' => 'option',
  78. 'update' => 'text',
  79. 'list' => true,
  80. ),
  81. 'num' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => '购买数量',
  85. 'default' => '',
  86. 'desc' => '购买数量',
  87. 'match' => 'is_numeric',
  88. 'search' => 'select',
  89. 'list' => true,
  90. ),
  91. 'status' => array
  92. (
  93. 'type' => 'int-11',
  94. 'name' => '状态',
  95. 'default' => '1',
  96. 'desc' => '状态',
  97. 'match' => 'is_numeric',
  98. //'update' => 'select',
  99. 'option' => $status,
  100. 'search' => 'select',
  101. 'list' => true,
  102. 'edit' => true,
  103. ),
  104. 'state' => array
  105. (
  106. 'type' => 'tinyint-1',
  107. 'name' => '状态',
  108. 'default' => '1',
  109. 'desc' => '请选择状态',
  110. 'match' => 'is_numeric',
  111. ),
  112. 'cdate' => array
  113. (
  114. 'type' => 'int-11',
  115. 'name' => '创建时间',
  116. 'match' => array('is_numeric', time()),
  117. 'desc' => '',
  118. # 只有insert时才生效
  119. 'insert' => true,
  120. 'search' => 'date',
  121. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  122. ),
  123. ),
  124. 'manage' => array
  125. (
  126. 'insert' => false,
  127. 'delete' => false,
  128. 'page_list' => 'dh_order_goods',
  129. ),
  130. 'request' => array
  131. (
  132. # 获取单条数据
  133. 'getIds' => array
  134. (
  135. # 匹配的正则或函数 选填项
  136. 'option' => array
  137. (
  138. 'uid' => 'yes',
  139. 'shop_id' => 'yes',
  140. 'order_id' => 'yes',
  141. 'status' => 1,
  142. 'state' => 1,
  143. ),
  144. 'type' => 'all',
  145. 'col' => '*|id',
  146. ),
  147. # 获取多条数据
  148. 'getDataByIds' => array
  149. (
  150. # 匹配的正则或函数 选填项
  151. 'option' => array
  152. (
  153. 'ids' => array('yes-id', 'in'),
  154. 'uid' => 'yes',
  155. 'shop_id' => 'yes',
  156. 'order_id' => 'yes',
  157. 'state' => 1,
  158. ),
  159. 'type' => 'all',
  160. 'col' => '*',
  161. ),
  162. # 获取多条数据
  163. 'getTotal' => array
  164. (
  165. # 匹配的正则或函数 选填项
  166. 'option' => array
  167. (
  168. 'order_id' => 'yes',
  169. 'status' => array('yes', 'in'),
  170. 'state' => 1,
  171. ),
  172. 'type' => 'count',
  173. 'col' => '*',
  174. ),
  175. # 获取订单数量
  176. 'getOrderNum' => array
  177. (
  178. # 匹配的正则或函数 选填项
  179. 'option' => array
  180. (
  181. 'start' => array('yes-cdate', '>='),
  182. 'end' => array('yes-cdate', '<='),
  183. 'shop_id' => 'yes',
  184. 'goods_id' => 'yes',
  185. 'status' => 'yes',
  186. 'state' => 1,
  187. ),
  188. 'type' => 'count',
  189. 'col' => '*',
  190. ),
  191. # 获取总金额
  192. 'getCashNum' => array
  193. (
  194. # 匹配的正则或函数 选填项
  195. 'option' => array
  196. (
  197. 'start' => array('yes-cdate', '>='),
  198. 'end' => array('yes-cdate', '<='),
  199. 'shop_id' => 'yes',
  200. 'goods_id' => 'yes',
  201. 'status' => 'yes',
  202. 'state' => 1,
  203. ),
  204. 'type' => 'one',
  205. 'col' => 'sum(price) as total',
  206. ),
  207. ),
  208. );