order.php 9.3 KB

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