order.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  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. $source_id = function()
  13. {
  14. $array = array
  15. (
  16. -1 => array
  17. (
  18. 'id' => '-1',
  19. 'name' => '无来源',
  20. ),
  21. );
  22. $data = Dever::load('setting/source-state');
  23. if($data)
  24. {
  25. $array += $data;
  26. }
  27. return $array;
  28. };
  29. $status = array
  30. (
  31. 1 => '待业务初审',
  32. 2 => '待财务终审',
  33. 3 => '待权益发放',
  34. 4 => '已完成',
  35. 5 => '已作废',
  36. 6 => '挂起',
  37. );
  38. $pay_status = array
  39. (
  40. 1 => '待支付',
  41. 2 => '已支付',
  42. 3 => '已退款',
  43. );
  44. $goods_status = array
  45. (
  46. 1 => '未发放',
  47. 2 => '无权益',
  48. 3 => '已发放',
  49. );
  50. $type = array
  51. (
  52. 1 => '个人',
  53. 2 => '公司',
  54. );
  55. $pay_type = array
  56. (
  57. 1 => '在线支付',
  58. 2 => '汇款',
  59. 3 => '个人转账',
  60. );
  61. $get_type = array
  62. (
  63. 1 => '购买',
  64. 2 => '赠送',
  65. );
  66. $level = function()
  67. {
  68. $array = array
  69. (
  70. -1 => array
  71. (
  72. 'id' => -1,
  73. 'name' => '普通',
  74. ),
  75. );
  76. $data = Dever::load('setting/level-state');
  77. if($data)
  78. {
  79. $array += $data;
  80. }
  81. return $array;
  82. };
  83. $order_type = array
  84. (
  85. 1 => '新购',
  86. 2 => '升级',
  87. );
  88. $button = array();
  89. $parent_mid = Dever::input('search_option_parent_mid');
  90. $mid = Dever::input('search_option_mid');
  91. $pmid = '';
  92. if ($parent_mid) {
  93. $pmid = $parent_mid;
  94. }
  95. if ($mid) {
  96. $pmid = $mid;
  97. }
  98. if ($pmid) {
  99. $button = array
  100. (
  101. '返回上一页' => array('location', 'l=project/database/list&project=agent&table=member_area&page_type=1&mid=' . $pmid),
  102. );
  103. }
  104. return array
  105. (
  106. # 表名
  107. 'name' => 'order',
  108. # 显示给用户看的名称
  109. 'lang' => '代理商订单',
  110. 'set' => array
  111. (
  112. 'status' => $status,
  113. 'pay_status' => $pay_status,
  114. 'goods_status' => $goods_status,
  115. 'type' => $type,
  116. 'pay_type' => $pay_type,
  117. 'order_type' => $order_type,
  118. ),
  119. 'order' => 99,
  120. # 数据结构
  121. 'struct' => array
  122. (
  123. 'id' => array
  124. (
  125. 'type' => 'int-11',
  126. 'name' => 'ID',
  127. 'default' => '',
  128. 'desc' => '',
  129. 'match' => 'is_numeric',
  130. 'search' => 'order',
  131. //'list' => true,
  132. ),
  133. 'mid' => array
  134. (
  135. 'type' => 'int-11',
  136. 'name' => '代理商',
  137. 'default' => '-1',
  138. 'desc' => '代理商',
  139. 'match' => 'is_string',
  140. 'update' => 'text',
  141. 'searchs' => array
  142. (
  143. 'api' => 'agent/member-find',
  144. 'col' => 'mobile',
  145. 'result' => 'id',
  146. ),
  147. //'list' => 'Dever::load("agent/member-find#name", {mid})',
  148. ),
  149. 'order_num' => array
  150. (
  151. 'type' => 'varchar-100',
  152. 'name' => '订单号',
  153. 'default' => '',
  154. 'desc' => '订单号',
  155. 'match' => 'is_string',
  156. 'update' => 'text',
  157. 'search' => 'fulltext',
  158. 'list' => true,
  159. 'list_order' => 1,
  160. ),
  161. 'order_type' => array
  162. (
  163. 'type' => 'tinyint-1',
  164. 'name' => '订单类型',
  165. 'default' => '1',
  166. 'desc' => '订单类型',
  167. 'match' => 'is_numeric',
  168. 'option' => $order_type,
  169. ),
  170. 'mobile' => array
  171. (
  172. 'type' => 'bigint-11',
  173. 'name' => '手机号',
  174. 'default' => '',
  175. 'desc' => '请输入手机号',
  176. 'match' => Dever::rule('mobile'),
  177. 'update' => 'text',
  178. 'search' => 'fulltext',
  179. //'list' => true,
  180. ),
  181. 'parent_mid' => array
  182. (
  183. 'type' => 'int-11',
  184. 'name' => '邀请人手机号',
  185. 'default' => '-1',
  186. 'desc' => '邀请人',
  187. 'match' => 'is_string',
  188. 'update' => 'text',
  189. 'search' => $parent_mid ? 'hidden' : array
  190. (
  191. 'api' => 'agent/member-find',
  192. 'col' => 'mobile',
  193. 'result' => 'id',
  194. ),
  195. 'list_name' => '邀请人',
  196. 'list' => 'Dever::load("agent/lib/member.getOne", {parent_mid})',
  197. 'list_order' => 4,
  198. ),
  199. 'source_id' => array
  200. (
  201. 'type' => 'int-11',
  202. 'name' => '注册来源',
  203. 'default' => '-1',
  204. 'desc' => '注册来源',
  205. 'match' => 'is_numeric',
  206. 'search' => 'select',
  207. 'update' => 'checkbox',
  208. 'option' => $source_id,
  209. 'list' => true,
  210. 'list_order' => 5,
  211. ),
  212. 'name' => array
  213. (
  214. 'type' => 'varchar-100',
  215. 'name' => '姓名',
  216. 'default' => '',
  217. 'desc' => '姓名',
  218. 'match' => 'is_string',
  219. 'update' => 'text',
  220. 'search' => 'fulltext',
  221. 'list' => 'Dever::load("agent/lib/member.getOne", {id}, "agent/order")',
  222. 'list_order' => 3,
  223. ),
  224. 'role' => array
  225. (
  226. 'type' => 'int-11',
  227. 'name' => '代理角色',
  228. 'default' => '',
  229. 'desc' => '代理角色',
  230. 'match' => 'is_numeric',
  231. 'search' => 'select',
  232. 'update' => 'checkbox',
  233. 'option' => $role,
  234. //'list' => true,
  235. ),
  236. 'area' => array
  237. (
  238. 'type' => 'varchar-500',
  239. 'name' => '区域',
  240. 'default' => '',
  241. 'desc' => '区域',
  242. 'match' => 'option',
  243. 'search' => 'linkage',
  244. 'update' => 'linkage',
  245. 'option' => Dever::url('api.get?level_total=4', 'area'),
  246. 'list' => 'Dever::load("area/api.string", "{area}")',
  247. ),
  248. 'desc' => array
  249. (
  250. 'type' => 'varchar-600',
  251. 'name' => '付款备注',
  252. 'default' => '',
  253. 'desc' => '付款备注',
  254. 'match' => 'is_string',
  255. 'update' => 'text',
  256. ),
  257. 'f_price' => array
  258. (
  259. 'type' => 'float-11,2',
  260. 'name' => '原价',
  261. 'default' => '0',
  262. 'desc' => '原价',
  263. 'match' => 'option',
  264. 'update' => 'text',
  265. ),
  266. 'price' => array
  267. (
  268. 'type' => 'float-11,2',
  269. 'name' => '实付金额',
  270. 'default' => '0',
  271. 'desc' => '金额',
  272. 'match' => 'option',
  273. 'update' => 'text',
  274. 'list' => true,
  275. 'list_order' => 6,
  276. ),
  277. 'pay_type' => array
  278. (
  279. 'type' => 'tinyint-1',
  280. 'name' => '支付方式',
  281. 'default' => '1',
  282. 'desc' => '支付方式',
  283. 'match' => 'is_numeric',
  284. 'search' => 'select',
  285. 'update' => 'select',
  286. 'option' => $pay_type,
  287. 'list' => true,
  288. 'list_order' => 7,
  289. ),
  290. 'pay_pic' => array
  291. (
  292. 'type' => 'varchar-150',
  293. 'name' => '打款凭证',
  294. 'default' => '',
  295. 'desc' => '打款凭证',
  296. 'match' => 'option',
  297. 'update' => 'image',
  298. 'key' => '1',
  299. 'place' => '150',
  300. ),
  301. 'pay_price' => array
  302. (
  303. 'type' => 'float-11,2',
  304. 'name' => '交款金额',
  305. 'default' => '0',
  306. 'desc' => '交款金额',
  307. 'match' => 'option',
  308. 'update' => 'text',
  309. ),
  310. 'bank_id' => array
  311. (
  312. 'type' => 'int-11',
  313. 'name' => '所属银行',
  314. 'default' => '',
  315. 'desc' => '所属银行',
  316. 'match' => 'is_numeric',
  317. ),
  318. 'bank_card' => array
  319. (
  320. 'type' => 'int-11',
  321. 'name' => '银行卡号',
  322. 'default' => '',
  323. 'desc' => '银行卡号',
  324. 'match' => 'is_numeric',
  325. ),
  326. 'type' => array
  327. (
  328. 'type' => 'tinyint-1',
  329. 'name' => '类型',
  330. 'default' => '1',
  331. 'desc' => '类型',
  332. 'match' => 'is_numeric',
  333. 'option' => $type,
  334. ),
  335. 'sign' => array
  336. (
  337. 'type' => 'varchar-150',
  338. 'name' => '手写签名',
  339. 'default' => '',
  340. 'desc' => '手写签名',
  341. 'match' => 'option',
  342. 'update' => 'image',
  343. 'key' => '7',
  344. ),
  345. 'idcard' => array
  346. (
  347. 'type' => 'varchar-100',
  348. 'name' => '身份证号码',
  349. 'default' => '',
  350. 'desc' => '身份证号码',
  351. 'match' => 'is_string',
  352. 'update' => 'text',
  353. 'search' => 'fulltext',
  354. ),
  355. 'idcard_front' => array
  356. (
  357. 'type' => 'varchar-150',
  358. 'name' => '身份证正面',
  359. 'default' => '',
  360. 'desc' => '身份证正面',
  361. 'match' => 'option',
  362. 'update' => 'image',
  363. 'key' => '8',
  364. 'place' => '660*660',
  365. ),
  366. 'idcard_back' => array
  367. (
  368. 'type' => 'varchar-150',
  369. 'name' => '身份证背面',
  370. 'default' => '',
  371. 'desc' => '身份证背面',
  372. 'match' => 'option',
  373. 'update' => 'image',
  374. 'key' => '8',
  375. 'place' => '660*660',
  376. ),
  377. 'company_name' => array
  378. (
  379. 'type' => 'varchar-100',
  380. 'name' => '公司名称',
  381. 'default' => '',
  382. 'desc' => '公司名称',
  383. 'match' => 'is_string',
  384. 'update' => 'text',
  385. //'search' => 'fulltext',
  386. //'list' => true,
  387. ),
  388. 'company_pic' => array
  389. (
  390. 'type' => 'varchar-150',
  391. 'name' => '营业执照',
  392. 'default' => '',
  393. 'desc' => '营业执照',
  394. 'match' => 'option',
  395. 'update' => 'image',
  396. 'key' => '8',
  397. 'place' => '660*660',
  398. ),
  399. 'company_number' => array
  400. (
  401. 'type' => 'varchar-80',
  402. 'name' => '营业执照号码',
  403. 'default' => '',
  404. 'desc' => '营业执照号码',
  405. 'match' => 'is_string',
  406. 'update' => 'text',
  407. ),
  408. 'address' => array
  409. (
  410. 'type' => 'varchar-800',
  411. 'name' => '地址',
  412. 'default' => '',
  413. 'desc' => '地址',
  414. 'match' => 'is_string',
  415. 'update' => 'text',
  416. ),
  417. 'status' => array
  418. (
  419. 'type' => 'tinyint-1',
  420. 'name' => '订单状态',
  421. 'default' => '1',
  422. 'desc' => '状态',
  423. 'match' => 'is_numeric',
  424. 'option' => $status,
  425. 'search' => 'select',
  426. 'list' => true,
  427. 'list_order' => 8,
  428. ),
  429. 'history_status' => array
  430. (
  431. 'type' => 'tinyint-1',
  432. 'name' => '记录挂起之前的状态',
  433. 'default' => '1',
  434. 'desc' => '状态',
  435. 'match' => 'is_numeric',
  436. 'option' => $status,
  437. ),
  438. 'goods_status' => array
  439. (
  440. 'type' => 'tinyint-1',
  441. 'name' => '权益状态',
  442. 'default' => '1',
  443. 'desc' => '权益状态',
  444. 'match' => 'is_numeric',
  445. 'option' => $goods_status,
  446. 'search' => 'select',
  447. 'list' => true,
  448. 'list_order' => 9,
  449. ),
  450. 'pay_status' => array
  451. (
  452. 'type' => 'tinyint-1',
  453. 'name' => '支付状态',
  454. 'default' => '1',
  455. 'desc' => '状态',
  456. 'match' => 'is_numeric',
  457. 'option' => $pay_status,
  458. ),
  459. 'get_type' => array
  460. (
  461. 'type' => 'tinyint-1',
  462. 'name' => '获取方式',
  463. 'default' => '1',
  464. 'desc' => '获取方式',
  465. 'match' => 'is_numeric',
  466. 'update' => 'radio',
  467. 'option' => $get_type,
  468. ),
  469. 'agent_cash' => array
  470. (
  471. 'type' => 'float-11,2',
  472. 'name' => '代理费',
  473. 'default' => '0',
  474. 'desc' => '代理费',
  475. 'match' => 'option',
  476. 'update' => 'text',
  477. ),
  478. 'soft_cash' => array
  479. (
  480. 'type' => 'float-11,2',
  481. 'name' => '软件服务费',
  482. 'default' => '0',
  483. 'desc' => '软件服务费',
  484. 'match' => 'option',
  485. 'update' => 'text',
  486. ),
  487. 'goods_cash' => array
  488. (
  489. 'type' => 'float-11,2',
  490. 'name' => '商品价值-名额不算,商品价值第一次分配后保持不变',
  491. 'default' => '0',
  492. 'desc' => '商品价值',
  493. 'match' => 'option',
  494. 'update' => 'text',
  495. ),
  496. 'state' => array
  497. (
  498. 'type' => 'tinyint-1',
  499. 'name' => '状态',
  500. 'default' => '1',
  501. 'desc' => '请选择状态',
  502. 'match' => 'is_numeric',
  503. ),
  504. 'fdate' => array
  505. (
  506. 'type' => 'int-11',
  507. 'name' => '完成时间',
  508. 'default' => '',
  509. 'match' => 'is_numeric',
  510. 'desc' => '',
  511. ),
  512. 'cdate' => array
  513. (
  514. 'type' => 'int-11',
  515. 'name' => '申请时间',
  516. 'match' => array('is_numeric', time()),
  517. 'desc' => '',
  518. # 只有insert时才生效
  519. //'insert' => true,
  520. 'search' => 'date',
  521. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  522. 'list_order' => 2,
  523. ),
  524. ),
  525. 'alter' => array
  526. (
  527. 4 => array
  528. (
  529. array('update', 'price', 'price', 'float-11,2 0 实付金额'),
  530. array('update', 'f_price', 'f_price', 'float-11,2 0 原价'),
  531. array('update', 'agent_cash', 'agent_cash', 'float-11,2 0 代理费'),
  532. array('update', 'soft_cash', 'soft_cash', 'float-11,2 0 软件服务费'),
  533. ),
  534. 'version' => 4,
  535. ),
  536. 'manage' => array
  537. (
  538. 'insert' => false,
  539. 'delete' => false,
  540. 'edit' => false,
  541. 'button' => $button,
  542. 'list_button' => array
  543. (
  544. //fast_list
  545. 'list' => array('查看详情', '"order_process&project=agent&order_id={id}&page_type=1"'),
  546. //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin,tk_status', '{status} == 6'),
  547. //'delete' => array('删除', '', '{status} == 1'),
  548. ),
  549. ),
  550. 'request' => array
  551. (
  552. 'getData' => array
  553. (
  554. # 匹配的正则或函数 选填项
  555. 'option' => array
  556. (
  557. 'mid' => 'yes',
  558. 'status' => array('yes', 'in'),
  559. 'state' => 1,
  560. ),
  561. 'order' => array('id' => 'desc'),
  562. 'page' => array(10, 'list'),
  563. 'type' => 'all',
  564. 'col' => '*',
  565. ),
  566. ),
  567. );