order.php 8.9 KB

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