order_temp.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  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. 'star_id' => array
  173. (
  174. 'type' => 'int-11',
  175. 'name' => '明星',
  176. 'default' => '',
  177. 'desc' => '明星',
  178. 'match' => 'is_numeric',
  179. 'update' => 'select',
  180. //'search' => 'select',
  181. //'list' => true,
  182. ),
  183. 'buy_id' => array
  184. (
  185. 'type' => 'int-11',
  186. 'name' => '购买本数',
  187. 'default' => '',
  188. 'desc' => '购买本数',
  189. 'match' => 'is_numeric',
  190. 'update' => 'select',
  191. 'option' => $buy,
  192. //'search' => 'select',
  193. //'list' => true,
  194. ),
  195. 'buy_num' => array
  196. (
  197. 'type' => 'int-11',
  198. 'name' => '购买本数',
  199. 'default' => '',
  200. 'desc' => '购买本数',
  201. 'match' => 'is_numeric',
  202. //'search' => 'select',
  203. //'list' => true,
  204. ),
  205. 'type' => array
  206. (
  207. 'type' => 'int-11',
  208. 'name' => '支付方式',
  209. 'default' => '1',
  210. 'desc' => '支付方式',
  211. 'match' => 'is_numeric',
  212. 'option' => $type,
  213. 'search' => 'select',
  214. 'update' => 'radio',
  215. //'list' => true,
  216. 'control' => 'type',
  217. ),
  218. 'system' => array
  219. (
  220. 'type' => 'int-11',
  221. 'name' => '系统',
  222. 'default' => '1',
  223. 'desc' => '系统',
  224. 'match' => 'is_numeric',
  225. 'option' => $system,
  226. 'search' => 'select',
  227. 'update' => 'radio',
  228. 'list' => true,
  229. ),
  230. 'source' => array
  231. (
  232. 'type' => 'int-11',
  233. 'name' => '渠道来源',
  234. 'default' => '1',
  235. 'desc' => '支付方式',
  236. 'match' => 'is_numeric',
  237. 'option' => $source,
  238. 'search' => 'select',
  239. 'update' => 'radio',
  240. 'list' => true,
  241. ),
  242. 'seller_id' => array
  243. (
  244. 'type' => 'int-11',
  245. 'name' => '销售商',
  246. 'default' => '1',
  247. 'desc' => '销售商',
  248. 'match' => 'is_numeric',
  249. 'update' => 'select',
  250. 'option' => $seller,
  251. 'search' => 'select',
  252. //'list' => true,
  253. ),
  254. 'notice' => array
  255. (
  256. 'type' => 'int-11',
  257. 'name' => '模板消息提醒次数',
  258. 'default' => '0',
  259. 'desc' => '模板消息提醒次数',
  260. 'match' => 'is_numeric',
  261. ),
  262. 'cash' => array
  263. (
  264. 'type' => 'varchar-50',
  265. 'name' => '支付金额',
  266. 'default' => '',
  267. 'desc' => '支付金额',
  268. 'match' => 'option',
  269. 'update' => 'text',
  270. //'list' => true,
  271. 'show' => 'type=1',
  272. ),
  273. 'code' => array
  274. (
  275. 'type' => 'varchar-50',
  276. 'name' => '使用的兑换码',
  277. 'default' => '',
  278. 'desc' => '使用的兑换码',
  279. 'match' => 'option',
  280. 'update' => 'text',
  281. //'list' => true,
  282. 'show' => 'type=2',
  283. ),
  284. 'status' => array
  285. (
  286. 'type' => 'tinyint-1',
  287. 'name' => '订单状态',
  288. 'default' => '1',
  289. 'desc' => '请选择订单状态',
  290. 'match' => 'is_numeric',
  291. 'option' => $status,
  292. 'search' => 'select',
  293. 'update' => 'radio',
  294. 'list' => true,
  295. //'list' => 'Dever::load("journal/lib/manage.showOrderStatusV1", "{id}")',
  296. 'control' => 'status',
  297. ),
  298. 'tk_pic' => array
  299. (
  300. 'type' => 'varchar-150',
  301. 'name' => '退款截图',
  302. 'default' => '',
  303. 'desc' => '退款截图',
  304. 'match' => 'is_string',
  305. 'update' => 'image',
  306. 'key' => 1
  307. ),
  308. 'tk_time' => array
  309. (
  310. 'type' => 'int-11',
  311. 'name' => '退款时间',
  312. 'default' => '',
  313. 'desc' => '退款时间',
  314. 'match' => 'option',
  315. //'list' => true,
  316. //'update' => 'date',
  317. 'callback' => 'maketime',
  318. 'show' => 'status=5',
  319. ),
  320. 'tk_admin' => array
  321. (
  322. 'type' => 'int-11',
  323. 'name' => '退款审核人',
  324. 'default' => '1',
  325. 'desc' => '退款审核人',
  326. 'match' => 'option',
  327. //'list' => true,
  328. 'show' => 'status=5',
  329. ),
  330. 'tk_desc' => array
  331. (
  332. 'type' => 'varchar-300',
  333. 'name' => '退款备注',
  334. 'default' => '',
  335. 'desc' => '退款备注',
  336. 'match' => 'option',
  337. 'update' => 'textarea',
  338. //'show' => 'status=5',
  339. ),
  340. 'state' => array
  341. (
  342. 'type' => 'tinyint-1',
  343. 'name' => '状态',
  344. 'default' => '1',
  345. 'desc' => '请选择状态',
  346. 'match' => 'is_numeric',
  347. ),
  348. 'cdate' => array
  349. (
  350. 'type' => 'int-11',
  351. 'name' => '下单时间',
  352. 'match' => array('is_numeric', time()),
  353. 'desc' => '',
  354. # 只有insert时才生效
  355. 'insert' => true,
  356. 'search' => 'date',
  357. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  358. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  359. ),
  360. 'info' => array
  361. (
  362. 'type' => 'varchar-300',
  363. 'name' => '备注',
  364. 'default' => '',
  365. 'desc' => '备注',
  366. 'match' => 'option',
  367. 'update' => 'textarea',
  368. //'show' => 'status=5'
  369. //'list' => '"{info}" ? "{info}" : "双击添加备注"',
  370. //'edit' => true,
  371. ),
  372. 'mobile' => array
  373. (
  374. 'type' => 'varchar-300',
  375. 'name' => '手机号',
  376. 'default' => '',
  377. 'desc' => '手机号',
  378. 'match' => 'option',
  379. //'show' => 'status=5'
  380. 'search' => array
  381. (
  382. 'api' => 'passport/user-all',//接口地址,最好是获取多条数据的地址
  383. 'col' => 'mobile',//要查询的字段
  384. 'result' => 'id',//返回的字段
  385. 'search' => 'uid',//本表的字段,默认为当前的字段
  386. ),
  387. ),
  388. ),
  389. 'top' => Dever::config('base')->top,
  390. # 增加这个,为了给当前的list增加一个option
  391. 'top_option' => array
  392. (
  393. 'value' => $auth,
  394. 'col' => 'cate_id',
  395. ),
  396. 'manage' => array
  397. (
  398. 'delete' => false,
  399. 'edit' => false,
  400. 'insert' => false,
  401. 'button' => array
  402. (
  403. //'导出订单' => array('location', 'journal/lib/manage.out'),
  404. ),
  405. 'list_button' => array(
  406. 'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} == 2 && ({type} == 1 || {type} == 3)'),
  407. //'delete' => array('删除', '', '{status} == 1'),
  408. ),
  409. ),
  410. 'request' => array
  411. (
  412. 'getAll' => array
  413. (
  414. # 匹配的正则或函数 选填项
  415. 'option' => array
  416. (
  417. 'type' => 'yes',
  418. 'create_uid' => 'yes',
  419. 'status' => array('1', '!='),
  420. 'uid' => 'yes',
  421. 'state' => 1,
  422. ),
  423. 'type' => 'all',
  424. 'order' => array('cdate' => 'desc'),
  425. 'page' => array(10, 'list'),
  426. 'col' => '*',
  427. ),
  428. 'getYes' => array
  429. (
  430. # 匹配的正则或函数 选填项
  431. 'option' => array
  432. (
  433. 'product_id' => 'yes',
  434. 'state' => 1,
  435. ),
  436. 'type' => 'all',
  437. 'order' => array('cdate' => 'desc'),
  438. 'col' => '*',
  439. ),
  440. # 获取提交订单超过12个小时
  441. 'getDataByTime' => array
  442. (
  443. # 匹配的正则或函数 选填项
  444. 'option' => array
  445. (
  446. 'cdate' => array('yes', '>='),
  447. 'notice' => 'yes',
  448. 'note' => 'yes',
  449. 'type' => array('yes', 'in'),
  450. 'state' => 1,
  451. ),
  452. 'type' => 'all',
  453. 'order' => array('cdate' => 'desc'),
  454. 'col' => '*',
  455. ),
  456. # 获取没有兑换码的订单
  457. 'getUnCode' => array
  458. (
  459. # 匹配的正则或函数 选填项
  460. 'option' => array
  461. (
  462. 'code' => array('yes', '='),
  463. 'status' => 'yes',
  464. 'type' => 'yes',
  465. 'state' => 1,
  466. ),
  467. 'type' => 'all',
  468. 'order' => array('id' => 'desc'),
  469. 'limit' => '0,100',
  470. 'col' => '*',
  471. ),
  472. # 获取1,2
  473. 'getBuy' => array
  474. (
  475. # 匹配的正则或函数 选填项
  476. 'option' => array
  477. (
  478. 'status' => 'yes',
  479. 'type' => array('yes', 'in'),
  480. 'product_id' => 'yes',
  481. 'order_id' => 'yes',
  482. 'uid' => 'yes',
  483. 'state' => 1,
  484. ),
  485. 'type' => 'all',
  486. 'order' => array('id' => 'desc'),
  487. 'col' => '*',
  488. ),
  489. 'getMyAll' => array
  490. (
  491. # 匹配的正则或函数 选填项
  492. 'option' => array
  493. (
  494. 'type' => 'yes',
  495. 'uid' => 'yes',
  496. 'status' => 'yes',
  497. 'cate_id' => 'yes',
  498. 'state' => 1,
  499. ),
  500. 'type' => 'all',
  501. 'order' => array('id' => 'desc'),
  502. 'page' => array(10, 'list'),
  503. 'col' => 'id,order_id,name,buy_num,cdate,cash,product_id,buy_id',
  504. ),
  505. # 删除未支付订单
  506. 'drop' => array
  507. (
  508. # 匹配的正则或函数 选填项
  509. 'where' => array
  510. (
  511. 'time' => array('yes-cdate', '<='),
  512. 'status' => 1,
  513. 'state' => 1,
  514. ),
  515. 'type' => 'delete',
  516. 'col' => 'id,order_id',
  517. ),
  518. # 获取数据
  519. 'getAllByDate' => array
  520. (
  521. # 匹配的正则或函数 选填项
  522. 'where' => array
  523. (
  524. 'time' => array('yes-cdate', '<='),
  525. ),
  526. 'type' => 'all',
  527. 'col' => 'id,order_id',
  528. ),
  529. ),
  530. );