order.php 16 KB

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