order.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <?php
  2. $system_source = Dever::config('base')->system_source;
  3. $mode = Dever::db('goods/info')->config['config_mode'];
  4. $shape = Dever::db('goods/info')->config['config_shape'];
  5. $platform = Dever::db('goods/info')->config['config_platform'];
  6. $confirm = array
  7. (
  8. 1 => '未确认',
  9. 2 => '已确认',
  10. );
  11. $status = Dever::config('base', 'pay')->pay['status'];
  12. $config = array
  13. (
  14. # 表名
  15. 'name' => 'order',
  16. # 显示给用户看的名称
  17. 'lang' => '商品订单',
  18. 'order' => 300,
  19. 'auto' => 1000000,
  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. //'list' => true,
  31. ),
  32. 'parent_uid' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '邀请人',
  36. 'default' => '0',
  37. 'desc' => '请选择用户',
  38. 'match' => 'is_numeric',
  39. //'update' => 'text',
  40. //'search' => 'select',
  41. 'search' => array
  42. (
  43. 'api' => 'passport/user-all',
  44. 'col' => 'username',
  45. 'result' => 'id',
  46. ),
  47. 'list_name' => '订单详情',
  48. 'list' => 'Dever::load("goods/manage.order", {id})',
  49. //'list' => '{parent_uid} > 0 ? Dever::load("passport/user-one#username", {parent_uid}) : "无邀请人"',
  50. ),
  51. 'uid' => array
  52. (
  53. 'type' => 'int-11',
  54. 'name' => '购买人',
  55. 'default' => '0',
  56. 'desc' => '请选择用户',
  57. 'match' => 'is_numeric',
  58. //'update' => 'text',
  59. //'search' => 'select',
  60. 'search' => array
  61. (
  62. 'api' => 'passport/user-all',
  63. 'col' => 'username',
  64. 'result' => 'id',
  65. ),
  66. //'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  67. ),
  68. 'type' => array
  69. (
  70. 'type' => 'varchar-32',
  71. 'name' => '所属数据源',
  72. 'default' => '',
  73. 'desc' => '所属数据源',
  74. 'match' => 'is_string',
  75. //'list' => true,
  76. ),
  77. 'type_id' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '数据源id',
  81. 'default' => '',
  82. 'desc' => '数据源id',
  83. //'match' => 'is_numeric',
  84. //'list' => true,
  85. ),
  86. 'info_id' => array
  87. (
  88. 'type' => 'int-11',
  89. 'name' => '商品ID',
  90. 'default' => '',
  91. 'desc' => '商品ID',
  92. 'match' => 'is_numeric',
  93. //'update' => 'text',
  94. //'list' => true,
  95. ),
  96. 'platform' => array
  97. (
  98. 'type' => 'int-11',
  99. 'name' => '平台',
  100. 'default' => '1',
  101. 'desc' => '平台',
  102. 'match' => 'is_numeric',
  103. 'option' => $platform,
  104. 'search' => 'select',
  105. ),
  106. 'shape' => array
  107. (
  108. 'type' => 'int-11',
  109. 'name' => '形态',
  110. 'default' => '1',
  111. 'desc' => '形态',
  112. 'match' => 'is_numeric',
  113. 'option' => $shape,
  114. 'search' => 'select',
  115. ),
  116. 'sku_id' => array
  117. (
  118. 'type' => 'int-11',
  119. 'name' => '商品SKUID',
  120. 'default' => '',
  121. 'desc' => '商品SKUID',
  122. 'match' => 'is_numeric',
  123. //'update' => 'text',
  124. //'list' => true,
  125. ),
  126. 'order_id' => array
  127. (
  128. 'type' => 'varchar-100',
  129. 'name' => '订单id',
  130. 'default' => '',
  131. 'desc' => '订单id',
  132. 'match' => 'is_string',
  133. 'search' => 'text',
  134. //'update' => 'text',
  135. //'list' => true,
  136. ),
  137. 'name' => array
  138. (
  139. 'type' => 'varchar-100',
  140. 'name' => '商品名称',
  141. 'default' => '',
  142. 'desc' => '商品名称',
  143. 'match' => 'is_string',
  144. 'search' => 'fulltext',
  145. //'update' => 'text',
  146. //'list' => true,
  147. ),
  148. 'cash' => array
  149. (
  150. 'type' => 'decimal-10,2',
  151. 'name' => '价格',
  152. 'default' => '',
  153. 'desc' => '价格',
  154. 'match' => 'option',
  155. //'update' => 'text',
  156. //'list' => true,
  157. ),
  158. 'num' => array
  159. (
  160. 'type' => 'int-11',
  161. 'name' => '数量',
  162. 'default' => '',
  163. 'desc' => '数量',
  164. 'match' => 'option',
  165. //'update' => 'text',
  166. //'list' => true,
  167. ),
  168. 'mode' => array
  169. (
  170. 'type' => 'int-11',
  171. 'name' => '配送方式',
  172. 'default' => '-1',
  173. 'desc' => '配送方式',
  174. 'match' => 'is_numeric',
  175. 'search' => 'select',
  176. 'option' => $mode,
  177. ),
  178. 'username' => array
  179. (
  180. 'type' => 'varchar-100',
  181. 'name' => '联系人',
  182. 'default' => '',
  183. 'desc' => '详细地址',
  184. 'match' => 'option',
  185. 'search' => 'fulltext',
  186. //'update' => 'text',
  187. //'list' => true,
  188. ),
  189. 'mobile' => array
  190. (
  191. 'type' => 'varchar-100',
  192. 'name' => '联系电话',
  193. 'default' => '',
  194. 'desc' => '联系电话',
  195. 'match' => 'option',
  196. 'search' => 'fulltext',
  197. //'update' => 'text',
  198. //'list' => true,
  199. ),
  200. 'area_id' => array
  201. (
  202. 'type' => 'varchar-500',
  203. 'name' => '地区',
  204. 'default' => '',
  205. 'desc' => '地区',
  206. 'match' => 'is_string',
  207. 'search' => 'linkage',
  208. //'update' => 'linkage',
  209. 'option' => Dever::url('api.get', 'area'),
  210. //'show' => 'mode=1',
  211. //'list' => 'Dever::load("area/api.string", "{area_id}")',
  212. ),
  213. 'address' => array
  214. (
  215. 'type' => 'varchar-1000',
  216. 'name' => '详细地址',
  217. 'default' => '',
  218. 'desc' => '详细地址',
  219. 'match' => 'option',
  220. //'update' => 'text',
  221. //'list' => true,
  222. ),
  223. 'store_id' => array
  224. (
  225. 'type' => 'int-11',
  226. 'name' => '自提点',
  227. 'default' => '',
  228. 'desc' => '自提点',
  229. 'match' => 'option',
  230. ),
  231. 'confirm' => array
  232. (
  233. 'type' => 'tinyint-1',
  234. 'name' => '确认收货',
  235. 'default' => '1',
  236. 'desc' => '确认收货',
  237. 'match' => 'is_numeric',
  238. 'option' => $confirm,
  239. 'list' => true,
  240. 'edit' => true,
  241. ),
  242. 'freight_id' => array
  243. (
  244. 'type' => 'int-11',
  245. 'name' => '运费模板',
  246. 'default' => '',
  247. 'desc' => '运费模板',
  248. 'match' => 'is_string',
  249. ),
  250. 'freight_price' => array
  251. (
  252. 'type' => 'decimal-10,2',
  253. 'name' => '运费',
  254. 'default' => '',
  255. 'desc' => '运费',
  256. 'match' => 'option',
  257. ),
  258. 'price' => array
  259. (
  260. 'type' => 'decimal-10,2',
  261. 'name' => '最终付款价格',
  262. 'default' => '',
  263. 'desc' => '最终付款价格',
  264. 'match' => 'option',
  265. 'update' => 'text',
  266. ),
  267. 'system_source' => array
  268. (
  269. 'type' => 'tinyint-1',
  270. 'name' => '所属终端',
  271. 'default' => '1',
  272. 'desc' => '所属终端',
  273. 'match' => 'is_numeric',
  274. 'option' => $system_source,
  275. //'update' => 'radio',
  276. 'search' => 'select',
  277. ),
  278. 'status' => array
  279. (
  280. 'type' => 'tinyint-1',
  281. 'name' => '订单状态',
  282. 'default' => '1',
  283. 'desc' => '订单状态',
  284. 'match' => 'is_numeric',
  285. //'update' => 'radio',
  286. 'option' => $status,
  287. 'search' => 'select',
  288. 'list' => true,
  289. ),
  290. 'state' => array
  291. (
  292. 'type' => 'tinyint-1',
  293. 'name' => '数据状态',
  294. 'default' => '1',
  295. 'desc' => '请选择状态',
  296. 'match' => 'is_numeric',
  297. ),
  298. 'pay_time' => array
  299. (
  300. 'type' => 'int-11',
  301. 'name' => '付款时间',
  302. 'default' => '',
  303. 'desc' => '付款时间',
  304. 'match' => 'option',
  305. 'search' => 'date',
  306. 'list' => '"{pay_time}" ? date("Y-m-d H:i:s", {pay_time}) : ""',
  307. //'update' => 'date',
  308. //'callback' => 'maketime',
  309. ),
  310. 'cdate' => array
  311. (
  312. 'type' => 'int-11',
  313. 'name' => '申请时间',
  314. 'match' => array('is_numeric', time()),
  315. 'desc' => '',
  316. # 只有insert时才生效
  317. 'insert' => true,
  318. 'search' => 'date',
  319. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  320. ),
  321. ),
  322. 'manage' => array
  323. (
  324. 'insert' => false,
  325. //'edit' => false,
  326. 'delete' => false,
  327. ),
  328. # request 请求接口定义
  329. 'request' => array
  330. (
  331. # 分页
  332. 'getData' => array
  333. (
  334. # 匹配的正则或函数 选填项
  335. 'option' => array
  336. (
  337. 'uid' => 'yes',
  338. 'type' => 'yes',
  339. 'type_id' => 'yes',
  340. 'status' => 'yes',
  341. 'state' => 1,
  342. ),
  343. 'type' => 'all',
  344. 'order' => array('id' => 'desc'),
  345. 'page' => array(10, 'list'),
  346. 'col' => '*',
  347. ),
  348. ),
  349. );
  350. return $config;