order_temp.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <?php
  2. $type = array
  3. (
  4. //1 => '购买小刊',
  5. //2 => '兑换小刊',
  6. 3 => '购买兑换码',
  7. //4 => '使用通用兑换码',
  8. );
  9. # 系统
  10. $system = array
  11. (
  12. 1 => '小程序',
  13. 2 => 'H5',
  14. 3 => 'ios',
  15. 4 => '安卓',
  16. );
  17. # 渠道
  18. $source = function()
  19. {
  20. return Dever::db('source/info')->state();
  21. };
  22. $status = array
  23. (
  24. 1 => '待支付',
  25. 2 => '已支付',
  26. 3 => '支付失败',
  27. //4 => '申请退款',
  28. 5 => '已退款',
  29. );
  30. $product = function()
  31. {
  32. return Dever::db('journal/info')->state();
  33. };
  34. $buy = function()
  35. {
  36. return Dever::db('journal/buy_num')->state();
  37. };
  38. # 获取小刊分类权限
  39. $auth = Dever::tops();
  40. $cate = function() use ($auth)
  41. {
  42. $array = array();
  43. if ($auth) {
  44. $info = Dever::db('journal/cate')->getIds(array('ids' => $auth));
  45. } else {
  46. $info = Dever::db('journal/cate')->state();
  47. }
  48. if($info)
  49. {
  50. $array += $info;
  51. }
  52. return $array;
  53. };
  54. $seller = function()
  55. {
  56. return Dever::db('code/seller')->state();
  57. };
  58. return array
  59. (
  60. # 表名
  61. 'name' => 'order_temp',
  62. # 显示给用户看的名称
  63. 'lang' => '临时订单管理',
  64. 'order' => 1,
  65. 'menu' => false,
  66. 'end' => array
  67. (
  68. 'update' => 'act/lib/pay.order',
  69. ),
  70. # 数据结构
  71. 'struct' => array
  72. (
  73. 'id' => array
  74. (
  75. 'type' => 'int-11',
  76. 'name' => 'ID',
  77. 'default' => '',
  78. 'desc' => '',
  79. 'match' => 'is_numeric',
  80. 'search' => 'order',
  81. //'list' => true,
  82. ),
  83. 'order_id' => array
  84. (
  85. 'type' => 'varchar-100',
  86. 'name' => '支付订单ID/订单表ID',
  87. 'default' => '',
  88. 'desc' => '付款订单id',
  89. 'match' => 'is_string',
  90. 'update' => 'text',
  91. 'search' => 'fulltext',
  92. //'list' => true,
  93. 'list' => 'Dever::load("act/order.getOrderTempId", {id})',
  94. ),
  95. 'cate_journal' => array
  96. (
  97. 'name' => '小刊',
  98. 'default' => '',
  99. 'desc' => '小刊',
  100. 'search' => 'linkage',
  101. 'search_col' => 'cate_id,product_id',
  102. 'option' => Dever::url('lib/manage.search_cate_journal', 'journal'),
  103. ),
  104. 'cate_id' => array
  105. (
  106. 'type' => 'int-11',
  107. 'name' => '小刊分类',
  108. 'default' => '1',
  109. 'desc' => '小刊分类',
  110. 'match' => 'is_numeric',
  111. 'update' => 'select',
  112. 'option' => $cate,
  113. //'search' => 'select',
  114. 'list' => true,
  115. ),
  116. 'name' => array
  117. (
  118. 'type' => 'varchar-80',
  119. 'name' => '订单名称',
  120. 'default' => '',
  121. 'desc' => '订单名称',
  122. 'match' => 'is_string',
  123. 'update' => 'text',
  124. 'search' => 'fulltext',
  125. 'list_name' => '订单信息',
  126. 'list' => 'Dever::load("journal/lib/manage.showOrderUserV1", "{id}")',
  127. ),
  128. 'uid' => array
  129. (
  130. 'type' => 'int-11',
  131. 'name' => '用户名',
  132. 'default' => '',
  133. 'desc' => '用户id',
  134. 'match' => 'is_numeric',
  135. 'search' => array
  136. (
  137. 'api' => 'passport/user-all',
  138. 'col' => 'username',
  139. 'result' => 'id',
  140. ),
  141. 'update' => 'text',
  142. ),
  143. 'source_uid' => array
  144. (
  145. 'type' => 'int-11',
  146. 'name' => '邀请人',
  147. 'default' => '',
  148. 'desc' => '邀请人',
  149. 'match' => 'is_numeric',
  150. 'update' => 'text',
  151. ),
  152. 'note' => array
  153. (
  154. 'type' => 'tinyint-1',
  155. 'name' => '是否发送状态提醒-1未发送,2已发送',
  156. 'default' => '1',
  157. 'desc' => '请选择状态',
  158. 'match' => 'is_numeric',
  159. ),
  160. 'product_id' => array
  161. (
  162. 'type' => 'int-11',
  163. 'name' => '小刊',
  164. 'default' => '',
  165. 'desc' => '小刊',
  166. 'match' => 'is_numeric',
  167. 'update' => 'select',
  168. 'option' => $product,
  169. //'search' => 'select',
  170. //'list' => true,
  171. ),
  172. 'buy_id' => array
  173. (
  174. 'type' => 'int-11',
  175. 'name' => '购买本数',
  176. 'default' => '',
  177. 'desc' => '购买本数',
  178. 'match' => 'is_numeric',
  179. 'update' => 'select',
  180. 'option' => $buy,
  181. //'search' => 'select',
  182. //'list' => true,
  183. ),
  184. 'buy_num' => array
  185. (
  186. 'type' => 'int-11',
  187. 'name' => '购买本数',
  188. 'default' => '',
  189. 'desc' => '购买本数',
  190. 'match' => 'is_numeric',
  191. //'search' => 'select',
  192. //'list' => true,
  193. ),
  194. 'type' => array
  195. (
  196. 'type' => 'int-11',
  197. 'name' => '支付方式',
  198. 'default' => '1',
  199. 'desc' => '支付方式',
  200. 'match' => 'is_numeric',
  201. 'option' => $type,
  202. 'search' => 'select',
  203. 'update' => 'radio',
  204. //'list' => true,
  205. 'control' => 'type',
  206. ),
  207. 'system' => array
  208. (
  209. 'type' => 'int-11',
  210. 'name' => '系统',
  211. 'default' => '1',
  212. 'desc' => '系统',
  213. 'match' => 'is_numeric',
  214. 'option' => $system,
  215. 'search' => 'select',
  216. 'update' => 'radio',
  217. 'list' => true,
  218. ),
  219. 'source' => array
  220. (
  221. 'type' => 'int-11',
  222. 'name' => '渠道来源',
  223. 'default' => '1',
  224. 'desc' => '支付方式',
  225. 'match' => 'is_numeric',
  226. 'option' => $source,
  227. 'search' => 'select',
  228. 'update' => 'radio',
  229. 'list' => true,
  230. ),
  231. 'seller_id' => array
  232. (
  233. 'type' => 'int-11',
  234. 'name' => '销售商',
  235. 'default' => '1',
  236. 'desc' => '销售商',
  237. 'match' => 'is_numeric',
  238. 'update' => 'select',
  239. 'option' => $seller,
  240. 'search' => 'select',
  241. //'list' => true,
  242. ),
  243. 'notice' => array
  244. (
  245. 'type' => 'int-11',
  246. 'name' => '模板消息提醒次数',
  247. 'default' => '0',
  248. 'desc' => '模板消息提醒次数',
  249. 'match' => 'is_numeric',
  250. ),
  251. 'cash' => array
  252. (
  253. 'type' => 'varchar-50',
  254. 'name' => '支付金额',
  255. 'default' => '',
  256. 'desc' => '支付金额',
  257. 'match' => 'option',
  258. 'update' => 'text',
  259. //'list' => true,
  260. 'show' => 'type=1',
  261. ),
  262. 'code' => array
  263. (
  264. 'type' => 'varchar-50',
  265. 'name' => '使用的兑换码',
  266. 'default' => '',
  267. 'desc' => '使用的兑换码',
  268. 'match' => 'option',
  269. 'update' => 'text',
  270. //'list' => true,
  271. 'show' => 'type=2',
  272. ),
  273. 'status' => array
  274. (
  275. 'type' => 'tinyint-1',
  276. 'name' => '订单状态',
  277. 'default' => '1',
  278. 'desc' => '请选择订单状态',
  279. 'match' => 'is_numeric',
  280. 'option' => $status,
  281. 'search' => 'select',
  282. 'update' => 'radio',
  283. 'list' => true,
  284. //'list' => 'Dever::load("journal/lib/manage.showOrderStatusV1", "{id}")',
  285. 'control' => 'status',
  286. ),
  287. 'tk_pic' => array
  288. (
  289. 'type' => 'varchar-150',
  290. 'name' => '退款截图',
  291. 'default' => '',
  292. 'desc' => '退款截图',
  293. 'match' => 'is_string',
  294. 'update' => 'image',
  295. 'key' => 1
  296. ),
  297. 'tk_time' => array
  298. (
  299. 'type' => 'int-11',
  300. 'name' => '退款时间',
  301. 'default' => '',
  302. 'desc' => '退款时间',
  303. 'match' => 'option',
  304. //'list' => true,
  305. //'update' => 'date',
  306. 'callback' => 'maketime',
  307. 'show' => 'status=5',
  308. ),
  309. 'tk_admin' => array
  310. (
  311. 'type' => 'int-11',
  312. 'name' => '退款审核人',
  313. 'default' => '1',
  314. 'desc' => '退款审核人',
  315. 'match' => 'option',
  316. //'list' => true,
  317. 'show' => 'status=5',
  318. ),
  319. 'tk_desc' => array
  320. (
  321. 'type' => 'varchar-300',
  322. 'name' => '退款备注',
  323. 'default' => '',
  324. 'desc' => '退款备注',
  325. 'match' => 'option',
  326. 'update' => 'textarea',
  327. //'show' => 'status=5',
  328. ),
  329. 'state' => array
  330. (
  331. 'type' => 'tinyint-1',
  332. 'name' => '状态',
  333. 'default' => '1',
  334. 'desc' => '请选择状态',
  335. 'match' => 'is_numeric',
  336. ),
  337. 'cdate' => array
  338. (
  339. 'type' => 'int-11',
  340. 'name' => '下单时间',
  341. 'match' => array('is_numeric', time()),
  342. 'desc' => '',
  343. # 只有insert时才生效
  344. 'insert' => true,
  345. 'search' => 'date',
  346. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  347. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  348. ),
  349. 'info' => array
  350. (
  351. 'type' => 'varchar-300',
  352. 'name' => '备注',
  353. 'default' => '',
  354. 'desc' => '备注',
  355. 'match' => 'option',
  356. 'update' => 'textarea',
  357. //'show' => 'status=5'
  358. //'list' => '"{info}" ? "{info}" : "双击添加备注"',
  359. //'edit' => true,
  360. ),
  361. 'mobile' => array
  362. (
  363. 'type' => 'varchar-300',
  364. 'name' => '手机号',
  365. 'default' => '',
  366. 'desc' => '手机号',
  367. 'match' => 'option',
  368. //'show' => 'status=5'
  369. 'search' => array
  370. (
  371. 'api' => 'passport/user-all',//接口地址,最好是获取多条数据的地址
  372. 'col' => 'mobile',//要查询的字段
  373. 'result' => 'id',//返回的字段
  374. 'search' => 'uid',//本表的字段,默认为当前的字段
  375. ),
  376. ),
  377. ),
  378. 'top' => Dever::config('base')->top,
  379. # 增加这个,为了给当前的list增加一个option
  380. 'top_option' => array
  381. (
  382. 'value' => $auth,
  383. 'col' => 'cate_id',
  384. ),
  385. 'manage' => array
  386. (
  387. 'delete' => false,
  388. 'edit' => false,
  389. 'insert' => false,
  390. 'button' => array
  391. (
  392. //'导出订单' => array('location', 'journal/lib/manage.out'),
  393. ),
  394. 'list_button' => array(
  395. 'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} == 2 && ({type} == 1 || {type} == 3)'),
  396. //'delete' => array('删除', '', '{status} == 1'),
  397. ),
  398. ),
  399. 'request' => array
  400. (
  401. 'getAll' => array
  402. (
  403. # 匹配的正则或函数 选填项
  404. 'option' => array
  405. (
  406. 'type' => 'yes',
  407. 'create_uid' => 'yes',
  408. 'status' => array('1', '!='),
  409. 'uid' => 'yes',
  410. 'state' => 1,
  411. ),
  412. 'type' => 'all',
  413. 'order' => array('cdate' => 'desc'),
  414. 'page' => array(10, 'list'),
  415. 'col' => '*',
  416. ),
  417. 'getYes' => array
  418. (
  419. # 匹配的正则或函数 选填项
  420. 'option' => array
  421. (
  422. 'product_id' => 'yes',
  423. 'state' => 1,
  424. ),
  425. 'type' => 'all',
  426. 'order' => array('cdate' => 'desc'),
  427. 'col' => '*',
  428. ),
  429. # 获取提交订单超过12个小时
  430. 'getDataByTime' => array
  431. (
  432. # 匹配的正则或函数 选填项
  433. 'option' => array
  434. (
  435. 'cdate' => array('yes', '>='),
  436. 'notice' => 'yes',
  437. 'note' => 'yes',
  438. 'type' => array('yes', 'in'),
  439. 'state' => 1,
  440. ),
  441. 'type' => 'all',
  442. 'order' => array('cdate' => 'desc'),
  443. 'col' => '*',
  444. ),
  445. # 获取没有兑换码的订单
  446. 'getUnCode' => array
  447. (
  448. # 匹配的正则或函数 选填项
  449. 'option' => array
  450. (
  451. 'code' => array('yes', '='),
  452. 'status' => 'yes',
  453. 'type' => 'yes',
  454. 'state' => 1,
  455. ),
  456. 'type' => 'all',
  457. 'order' => array('id' => 'desc'),
  458. 'limit' => '0,100',
  459. 'col' => '*',
  460. ),
  461. # 获取1,2
  462. 'getBuy' => array
  463. (
  464. # 匹配的正则或函数 选填项
  465. 'option' => array
  466. (
  467. 'status' => 'yes',
  468. 'type' => array('yes', 'in'),
  469. 'product_id' => 'yes',
  470. 'order_id' => 'yes',
  471. 'uid' => 'yes',
  472. 'state' => 1,
  473. ),
  474. 'type' => 'all',
  475. 'order' => array('id' => 'desc'),
  476. 'col' => '*',
  477. ),
  478. 'getMyAll' => array
  479. (
  480. # 匹配的正则或函数 选填项
  481. 'option' => array
  482. (
  483. 'type' => 'yes',
  484. 'uid' => 'yes',
  485. 'status' => 'yes',
  486. 'cate_id' => 'yes',
  487. 'state' => 1,
  488. ),
  489. 'type' => 'all',
  490. 'order' => array('id' => 'desc'),
  491. 'page' => array(10, 'list'),
  492. 'col' => 'id,order_id,name,buy_num,cdate,cash,product_id,buy_id',
  493. ),
  494. # 删除未支付订单
  495. 'drop' => array
  496. (
  497. # 匹配的正则或函数 选填项
  498. 'where' => array
  499. (
  500. 'time' => array('yes-cdate', '<='),
  501. 'status' => 1,
  502. 'state' => 1,
  503. ),
  504. 'type' => 'delete',
  505. 'col' => 'id,order_id',
  506. ),
  507. # 获取数据
  508. 'getAllByDate' => array
  509. (
  510. # 匹配的正则或函数 选填项
  511. 'where' => array
  512. (
  513. 'time' => array('yes-cdate', '<='),
  514. ),
  515. 'type' => 'all',
  516. 'col' => 'id,order_id',
  517. ),
  518. ),
  519. );