order.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. <?php
  2. $role = function()
  3. {
  4. $array = array();
  5. $data = Dever::load('setting/role-state');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. $status = array
  13. (
  14. 1 => '待业务初审',
  15. 2 => '待财务终审',
  16. 3 => '待权益发放',
  17. 4 => '已完成',
  18. 5 => '已作废',
  19. );
  20. $pay_status = array
  21. (
  22. 1 => '待支付',
  23. 2 => '已支付',
  24. 3 => '已退款',
  25. );
  26. $goods_status = array
  27. (
  28. 1 => '未发放',
  29. 2 => '无权益',
  30. 3 => '已发放',
  31. );
  32. $type = array
  33. (
  34. 1 => '个人',
  35. 2 => '公司',
  36. );
  37. $pay_type = array
  38. (
  39. 1 => '在线支付',
  40. 2 => '汇款',
  41. 3 => '个人转账',
  42. );
  43. $get_type = array
  44. (
  45. 1 => '购买',
  46. 2 => '赠送',
  47. );
  48. $level = function()
  49. {
  50. $array = array
  51. (
  52. -1 => array
  53. (
  54. 'id' => -1,
  55. 'name' => '普通',
  56. ),
  57. );
  58. $data = Dever::load('setting/level-state');
  59. if($data)
  60. {
  61. $array += $data;
  62. }
  63. return $array;
  64. };
  65. $order_type = array
  66. (
  67. 1 => '新购',
  68. 2 => '升级',
  69. );
  70. return array
  71. (
  72. # 表名
  73. 'name' => 'order',
  74. # 显示给用户看的名称
  75. 'lang' => '代理商订单',
  76. 'set' => array
  77. (
  78. 'status' => $status,
  79. 'pay_status' => $pay_status,
  80. 'goods_status' => $goods_status,
  81. 'type' => $type,
  82. 'pay_type' => $pay_type,
  83. 'order_type' => $order_type,
  84. ),
  85. 'order' => 99,
  86. # 数据结构
  87. 'struct' => array
  88. (
  89. 'id' => array
  90. (
  91. 'type' => 'int-11',
  92. 'name' => 'ID',
  93. 'default' => '',
  94. 'desc' => '',
  95. 'match' => 'is_numeric',
  96. 'search' => 'order',
  97. //'list' => true,
  98. ),
  99. 'mid' => array
  100. (
  101. 'type' => 'int-11',
  102. 'name' => '代理商',
  103. 'default' => '-1',
  104. 'desc' => '代理商',
  105. 'match' => 'is_string',
  106. 'update' => 'text',
  107. 'searchs' => array
  108. (
  109. 'api' => 'agent/member-select',
  110. 'col' => 'name',
  111. 'result' => 'id',
  112. ),
  113. //'list' => 'Dever::load("agent/member-find#name", {mid})',
  114. ),
  115. 'order_num' => array
  116. (
  117. 'type' => 'varchar-100',
  118. 'name' => '订单号',
  119. 'default' => '',
  120. 'desc' => '订单号',
  121. 'match' => 'is_string',
  122. 'update' => 'text',
  123. 'search' => 'fulltext',
  124. 'list' => true,
  125. ),
  126. 'order_type' => array
  127. (
  128. 'type' => 'tinyint-1',
  129. 'name' => '订单类型',
  130. 'default' => '1',
  131. 'desc' => '订单类型',
  132. 'match' => 'is_numeric',
  133. 'option' => $order_type,
  134. ),
  135. 'mobile' => array
  136. (
  137. 'type' => 'bigint-11',
  138. 'name' => '手机号',
  139. 'default' => '',
  140. 'desc' => '请输入手机号',
  141. 'match' => Dever::rule('mobile'),
  142. 'update' => 'text',
  143. 'search' => 'fulltext',
  144. 'list' => true,
  145. ),
  146. 'parent_mid' => array
  147. (
  148. 'type' => 'int-11',
  149. 'name' => '邀请人',
  150. 'default' => '-1',
  151. 'desc' => '邀请人',
  152. 'match' => 'is_string',
  153. 'update' => 'text',
  154. 'search' => array
  155. (
  156. 'api' => 'agent/member-select',
  157. 'col' => 'name',
  158. 'result' => 'id',
  159. ),
  160. 'list' => 'Dever::load("agent/member-find#name", {parent_mid})',
  161. ),
  162. 'name' => array
  163. (
  164. 'type' => 'varchar-100',
  165. 'name' => '姓名',
  166. 'default' => '',
  167. 'desc' => '姓名',
  168. 'match' => 'is_string',
  169. 'update' => 'text',
  170. 'search' => 'fulltext',
  171. 'list' => true,
  172. ),
  173. 'role' => array
  174. (
  175. 'type' => 'int-11',
  176. 'name' => '代理角色',
  177. 'default' => '',
  178. 'desc' => '代理角色',
  179. 'match' => 'is_numeric',
  180. 'search' => 'select',
  181. 'update' => 'checkbox',
  182. 'option' => $role,
  183. 'list' => true,
  184. ),
  185. 'area' => array
  186. (
  187. 'type' => 'varchar-500',
  188. 'name' => '区域',
  189. 'default' => '',
  190. 'desc' => '区域',
  191. 'match' => 'option',
  192. 'search' => 'linkage',
  193. 'update' => 'linkage',
  194. 'option' => Dever::url('api.get?level_total=4', 'area'),
  195. 'list' => 'Dever::load("area/api.string", "{area}")',
  196. ),
  197. 'desc' => array
  198. (
  199. 'type' => 'varchar-600',
  200. 'name' => '付款备注',
  201. 'default' => '',
  202. 'desc' => '付款备注',
  203. 'match' => 'is_string',
  204. 'update' => 'text',
  205. ),
  206. 'price' => array
  207. (
  208. 'type' => 'varchar-50',
  209. 'name' => '金额',
  210. 'default' => '0',
  211. 'desc' => '金额',
  212. 'match' => 'option',
  213. 'update' => 'text',
  214. 'list' => true,
  215. ),
  216. 'pay_type' => array
  217. (
  218. 'type' => 'tinyint-1',
  219. 'name' => '支付方式',
  220. 'default' => '1',
  221. 'desc' => '支付方式',
  222. 'match' => 'is_numeric',
  223. 'search' => 'select',
  224. 'update' => 'select',
  225. 'option' => $pay_type,
  226. 'list' => true,
  227. ),
  228. 'pay_pic' => array
  229. (
  230. 'type' => 'varchar-150',
  231. 'name' => '打款凭证',
  232. 'default' => '',
  233. 'desc' => '打款凭证',
  234. 'match' => 'option',
  235. 'update' => 'image',
  236. 'key' => '1',
  237. 'place' => '150',
  238. ),
  239. 'bank_id' => array
  240. (
  241. 'type' => 'int-11',
  242. 'name' => '所属银行',
  243. 'default' => '',
  244. 'desc' => '所属银行',
  245. 'match' => 'is_numeric',
  246. ),
  247. 'bank_card' => array
  248. (
  249. 'type' => 'int-11',
  250. 'name' => '银行卡号',
  251. 'default' => '',
  252. 'desc' => '银行卡号',
  253. 'match' => 'is_numeric',
  254. ),
  255. 'type' => array
  256. (
  257. 'type' => 'tinyint-1',
  258. 'name' => '类型',
  259. 'default' => '1',
  260. 'desc' => '类型',
  261. 'match' => 'is_numeric',
  262. 'option' => $type,
  263. ),
  264. 'sign' => array
  265. (
  266. 'type' => 'varchar-150',
  267. 'name' => '手写签名',
  268. 'default' => '',
  269. 'desc' => '手写签名',
  270. 'match' => 'option',
  271. 'update' => 'image',
  272. 'key' => '7',
  273. ),
  274. 'idcard' => array
  275. (
  276. 'type' => 'varchar-100',
  277. 'name' => '身份证号码/营业执照号码',
  278. 'default' => '',
  279. 'desc' => '身份证号码',
  280. 'match' => 'is_string',
  281. 'update' => 'text',
  282. 'search' => 'fulltext',
  283. ),
  284. 'idcard_front' => array
  285. (
  286. 'type' => 'varchar-150',
  287. 'name' => '身份证正面',
  288. 'default' => '',
  289. 'desc' => '身份证正面',
  290. 'match' => 'option',
  291. 'update' => 'image',
  292. 'key' => '8',
  293. 'place' => '660*660',
  294. ),
  295. 'idcard_back' => array
  296. (
  297. 'type' => 'varchar-150',
  298. 'name' => '身份证背面',
  299. 'default' => '',
  300. 'desc' => '身份证背面',
  301. 'match' => 'option',
  302. 'update' => 'image',
  303. 'key' => '8',
  304. 'place' => '660*660',
  305. ),
  306. 'status' => array
  307. (
  308. 'type' => 'tinyint-1',
  309. 'name' => '订单状态',
  310. 'default' => '1',
  311. 'desc' => '状态',
  312. 'match' => 'is_numeric',
  313. 'option' => $status,
  314. 'search' => 'select',
  315. 'list' => true,
  316. ),
  317. 'goods_status' => array
  318. (
  319. 'type' => 'tinyint-1',
  320. 'name' => '权益状态',
  321. 'default' => '1',
  322. 'desc' => '权益状态',
  323. 'match' => 'is_numeric',
  324. 'option' => $goods_status,
  325. 'search' => 'select',
  326. 'list' => true,
  327. ),
  328. 'pay_status' => array
  329. (
  330. 'type' => 'tinyint-1',
  331. 'name' => '支付状态',
  332. 'default' => '1',
  333. 'desc' => '状态',
  334. 'match' => 'is_numeric',
  335. 'option' => $pay_status,
  336. ),
  337. 'get_type' => array
  338. (
  339. 'type' => 'tinyint-1',
  340. 'name' => '获取方式',
  341. 'default' => '1',
  342. 'desc' => '获取方式',
  343. 'match' => 'is_numeric',
  344. 'update' => 'radio',
  345. 'option' => $get_type,
  346. ),
  347. 'soft_cash' => array
  348. (
  349. 'type' => 'varchar-50',
  350. 'name' => '代理费',
  351. 'default' => '0',
  352. 'desc' => '代理费',
  353. 'match' => 'option',
  354. 'update' => 'text',
  355. ),
  356. 'state' => array
  357. (
  358. 'type' => 'tinyint-1',
  359. 'name' => '状态',
  360. 'default' => '1',
  361. 'desc' => '请选择状态',
  362. 'match' => 'is_numeric',
  363. ),
  364. 'fdate' => array
  365. (
  366. 'type' => 'int-11',
  367. 'name' => '完成时间',
  368. 'default' => '',
  369. 'match' => 'is_numeric',
  370. 'desc' => '',
  371. ),
  372. 'cdate' => array
  373. (
  374. 'type' => 'int-11',
  375. 'name' => '申请时间',
  376. 'match' => array('is_numeric', time()),
  377. 'desc' => '',
  378. # 只有insert时才生效
  379. //'insert' => true,
  380. 'search' => 'date',
  381. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  382. ),
  383. ),
  384. 'manage' => array
  385. (
  386. 'insert' => false,
  387. 'delete' => false,
  388. 'edit' => false,
  389. 'list_button' => array
  390. (
  391. //fast_list
  392. 'list' => array('查看详情', '"order_process&project=agent&order_id={id}&page_type=1"'),
  393. //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin,tk_status', '{status} == 6'),
  394. //'delete' => array('删除', '', '{status} == 1'),
  395. ),
  396. ),
  397. 'request' => array
  398. (
  399. 'getData' => array
  400. (
  401. # 匹配的正则或函数 选填项
  402. 'option' => array
  403. (
  404. 'status' => array('yes', 'in'),
  405. 'state' => 1,
  406. ),
  407. 'order' => array('id' => 'desc'),
  408. 'page' => array(20, 'list'),
  409. 'type' => 'all',
  410. 'col' => '*',
  411. ),
  412. ),
  413. );