order.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  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. 'f_price' => array
  207. (
  208. 'type' => 'float-11',
  209. 'name' => '原价',
  210. 'default' => '0',
  211. 'desc' => '原价',
  212. 'match' => 'option',
  213. 'update' => 'text',
  214. ),
  215. 'price' => array
  216. (
  217. 'type' => 'float-11',
  218. 'name' => '实付金额',
  219. 'default' => '0',
  220. 'desc' => '金额',
  221. 'match' => 'option',
  222. 'update' => 'text',
  223. 'list' => true,
  224. ),
  225. 'pay_type' => array
  226. (
  227. 'type' => 'tinyint-1',
  228. 'name' => '支付方式',
  229. 'default' => '1',
  230. 'desc' => '支付方式',
  231. 'match' => 'is_numeric',
  232. 'search' => 'select',
  233. 'update' => 'select',
  234. 'option' => $pay_type,
  235. 'list' => true,
  236. ),
  237. 'pay_pic' => array
  238. (
  239. 'type' => 'varchar-150',
  240. 'name' => '打款凭证',
  241. 'default' => '',
  242. 'desc' => '打款凭证',
  243. 'match' => 'option',
  244. 'update' => 'image',
  245. 'key' => '1',
  246. 'place' => '150',
  247. ),
  248. 'pay_price' => array
  249. (
  250. 'type' => 'float-11',
  251. 'name' => '交款金额',
  252. 'default' => '0',
  253. 'desc' => '交款金额',
  254. 'match' => 'option',
  255. 'update' => 'text',
  256. ),
  257. 'bank_id' => array
  258. (
  259. 'type' => 'int-11',
  260. 'name' => '所属银行',
  261. 'default' => '',
  262. 'desc' => '所属银行',
  263. 'match' => 'is_numeric',
  264. ),
  265. 'bank_card' => array
  266. (
  267. 'type' => 'int-11',
  268. 'name' => '银行卡号',
  269. 'default' => '',
  270. 'desc' => '银行卡号',
  271. 'match' => 'is_numeric',
  272. ),
  273. 'type' => array
  274. (
  275. 'type' => 'tinyint-1',
  276. 'name' => '类型',
  277. 'default' => '1',
  278. 'desc' => '类型',
  279. 'match' => 'is_numeric',
  280. 'option' => $type,
  281. ),
  282. 'sign' => array
  283. (
  284. 'type' => 'varchar-150',
  285. 'name' => '手写签名',
  286. 'default' => '',
  287. 'desc' => '手写签名',
  288. 'match' => 'option',
  289. 'update' => 'image',
  290. 'key' => '7',
  291. ),
  292. 'idcard' => array
  293. (
  294. 'type' => 'varchar-100',
  295. 'name' => '身份证号码/营业执照号码',
  296. 'default' => '',
  297. 'desc' => '身份证号码',
  298. 'match' => 'is_string',
  299. 'update' => 'text',
  300. 'search' => 'fulltext',
  301. ),
  302. 'idcard_front' => array
  303. (
  304. 'type' => 'varchar-150',
  305. 'name' => '身份证正面',
  306. 'default' => '',
  307. 'desc' => '身份证正面',
  308. 'match' => 'option',
  309. 'update' => 'image',
  310. 'key' => '8',
  311. 'place' => '660*660',
  312. ),
  313. 'idcard_back' => array
  314. (
  315. 'type' => 'varchar-150',
  316. 'name' => '身份证背面',
  317. 'default' => '',
  318. 'desc' => '身份证背面',
  319. 'match' => 'option',
  320. 'update' => 'image',
  321. 'key' => '8',
  322. 'place' => '660*660',
  323. ),
  324. 'company_name' => array
  325. (
  326. 'type' => 'varchar-100',
  327. 'name' => '公司名称',
  328. 'default' => '',
  329. 'desc' => '公司名称',
  330. 'match' => 'is_string',
  331. 'update' => 'text',
  332. //'search' => 'fulltext',
  333. //'list' => true,
  334. ),
  335. 'company_pic' => array
  336. (
  337. 'type' => 'varchar-150',
  338. 'name' => '营业执照',
  339. 'default' => '',
  340. 'desc' => '营业执照',
  341. 'match' => 'option',
  342. 'update' => 'image',
  343. 'key' => '8',
  344. 'place' => '660*660',
  345. ),
  346. 'company_number' => array
  347. (
  348. 'type' => 'varchar-80',
  349. 'name' => '营业执照号码',
  350. 'default' => '',
  351. 'desc' => '营业执照号码',
  352. 'match' => 'is_string',
  353. 'update' => 'text',
  354. ),
  355. 'status' => array
  356. (
  357. 'type' => 'tinyint-1',
  358. 'name' => '订单状态',
  359. 'default' => '1',
  360. 'desc' => '状态',
  361. 'match' => 'is_numeric',
  362. 'option' => $status,
  363. 'search' => 'select',
  364. 'list' => true,
  365. ),
  366. 'goods_status' => array
  367. (
  368. 'type' => 'tinyint-1',
  369. 'name' => '权益状态',
  370. 'default' => '1',
  371. 'desc' => '权益状态',
  372. 'match' => 'is_numeric',
  373. 'option' => $goods_status,
  374. 'search' => 'select',
  375. 'list' => true,
  376. ),
  377. 'pay_status' => array
  378. (
  379. 'type' => 'tinyint-1',
  380. 'name' => '支付状态',
  381. 'default' => '1',
  382. 'desc' => '状态',
  383. 'match' => 'is_numeric',
  384. 'option' => $pay_status,
  385. ),
  386. 'get_type' => array
  387. (
  388. 'type' => 'tinyint-1',
  389. 'name' => '获取方式',
  390. 'default' => '1',
  391. 'desc' => '获取方式',
  392. 'match' => 'is_numeric',
  393. 'update' => 'radio',
  394. 'option' => $get_type,
  395. ),
  396. 'agent_cash' => array
  397. (
  398. 'type' => 'float-11',
  399. 'name' => '代理费',
  400. 'default' => '0',
  401. 'desc' => '代理费',
  402. 'match' => 'option',
  403. 'update' => 'text',
  404. ),
  405. 'soft_cash' => array
  406. (
  407. 'type' => 'float-11',
  408. 'name' => '软件服务费',
  409. 'default' => '0',
  410. 'desc' => '软件服务费',
  411. 'match' => 'option',
  412. 'update' => 'text',
  413. ),
  414. 'state' => array
  415. (
  416. 'type' => 'tinyint-1',
  417. 'name' => '状态',
  418. 'default' => '1',
  419. 'desc' => '请选择状态',
  420. 'match' => 'is_numeric',
  421. ),
  422. 'fdate' => array
  423. (
  424. 'type' => 'int-11',
  425. 'name' => '完成时间',
  426. 'default' => '',
  427. 'match' => 'is_numeric',
  428. 'desc' => '',
  429. ),
  430. 'cdate' => array
  431. (
  432. 'type' => 'int-11',
  433. 'name' => '申请时间',
  434. 'match' => array('is_numeric', time()),
  435. 'desc' => '',
  436. # 只有insert时才生效
  437. //'insert' => true,
  438. 'search' => 'date',
  439. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  440. ),
  441. ),
  442. 'manage' => array
  443. (
  444. 'insert' => false,
  445. 'delete' => false,
  446. 'edit' => false,
  447. 'list_button' => array
  448. (
  449. //fast_list
  450. 'list' => array('查看详情', '"order_process&project=agent&order_id={id}&page_type=1"'),
  451. //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin,tk_status', '{status} == 6'),
  452. //'delete' => array('删除', '', '{status} == 1'),
  453. ),
  454. ),
  455. 'request' => array
  456. (
  457. 'getData' => array
  458. (
  459. # 匹配的正则或函数 选填项
  460. 'option' => array
  461. (
  462. 'mid' => 'yes',
  463. 'status' => array('yes', 'in'),
  464. 'state' => 1,
  465. ),
  466. 'order' => array('id' => 'desc'),
  467. 'page' => array(10, 'list'),
  468. 'type' => 'all',
  469. 'col' => '*',
  470. ),
  471. ),
  472. );