order.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <?php
  2. $type = array
  3. (
  4. 1 => '购买会员',
  5. );
  6. # 系统
  7. $system = array
  8. (
  9. 1 => '小程序',
  10. 2 => 'H5',
  11. 3 => 'ios',
  12. 4 => '安卓',
  13. );
  14. # 渠道
  15. $source = function()
  16. {
  17. return Dever::db('source/info')->state();
  18. };
  19. $status = array
  20. (
  21. 1 => '待支付',
  22. 2 => '已支付',
  23. 3 => '支付失败',
  24. //4 => '申请退款',
  25. 5 => '已退款',
  26. );
  27. $seller = function()
  28. {
  29. return Dever::db('code/seller')->state();
  30. };
  31. # 获取小刊分类权限
  32. $auth = Dever::tops();
  33. $cate = function() use ($auth)
  34. {
  35. $array = array();
  36. if ($auth) {
  37. $info = Dever::db('journal/cate')->getIds(array('ids' => $auth));
  38. } else {
  39. $info = Dever::db('journal/cate')->state();
  40. }
  41. if($info)
  42. {
  43. $array += $info;
  44. }
  45. return $array;
  46. };
  47. return array
  48. (
  49. # 表名
  50. 'name' => 'order',
  51. # 显示给用户看的名称
  52. 'lang' => '订单管理',
  53. 'order' => 1,
  54. 'end' => array
  55. (
  56. //'update' => 'journal/lib/manage.order',
  57. ),
  58. # 数据结构
  59. 'struct' => array
  60. (
  61. 'id' => array
  62. (
  63. 'type' => 'int-11',
  64. 'name' => 'ID',
  65. 'default' => '',
  66. 'desc' => '',
  67. 'match' => 'is_numeric',
  68. 'search' => 'order',
  69. //'list' => true,
  70. ),
  71. 'order_id' => array
  72. (
  73. 'type' => 'varchar-100',
  74. 'name' => '订单id',
  75. 'default' => '',
  76. 'desc' => '付款订单id',
  77. 'match' => 'is_string',
  78. 'update' => 'text',
  79. 'search' => 'fulltext',
  80. 'list' => true,
  81. //'list' => '"{order_id}" ? "{order_id}" : "{code}"',
  82. ),
  83. 'cate_journal' => array
  84. (
  85. 'name' => '小刊',
  86. 'default' => '',
  87. 'desc' => '小刊',
  88. 'search' => 'linkage',
  89. 'search_col' => 'cate_id,product_id',
  90. 'option' => Dever::url('lib/manage.search_cate_journal', 'journal'),
  91. ),
  92. 'cate_id' => array
  93. (
  94. 'type' => 'int-11',
  95. 'name' => '小刊分类',
  96. 'default' => '1',
  97. 'desc' => '小刊分类',
  98. 'match' => 'is_numeric',
  99. 'update' => 'select',
  100. 'option' => $cate,
  101. //'search' => 'select',
  102. 'list' => true,
  103. ),
  104. 'name' => array
  105. (
  106. 'type' => 'varchar-80',
  107. 'name' => '订单名称',
  108. 'default' => '',
  109. 'desc' => '订单名称',
  110. 'match' => 'is_string',
  111. 'update' => 'text',
  112. 'search' => 'fulltext',
  113. //'list_name' => '订单信息',
  114. //'list' => 'Dever::load("journal/lib/manage.showOrderUser", "{id}")',
  115. 'list' => true,
  116. ),
  117. 'uid' => array
  118. (
  119. 'type' => 'int-11',
  120. 'name' => '用户名',
  121. 'default' => '',
  122. 'desc' => '用户id',
  123. 'match' => 'is_numeric',
  124. 'search' => array
  125. (
  126. 'api' => 'passport/user-all',
  127. 'col' => 'username',
  128. 'result' => 'id',
  129. ),
  130. 'update' => 'text',
  131. ),
  132. 'buy_id' => array
  133. (
  134. 'type' => 'int-11',
  135. 'name' => '时效id',
  136. 'default' => '',
  137. 'desc' => '时效id',
  138. 'match' => 'is_numeric',
  139. 'update' => 'text',
  140. ),
  141. 'mobile' => array
  142. (
  143. 'type' => 'varchar-300',
  144. 'name' => '手机号',
  145. 'default' => '',
  146. 'desc' => '手机号',
  147. 'match' => 'option',
  148. //'show' => 'status=5'
  149. 'search' => 'fulltext',
  150. 'list' => true,
  151. ),
  152. 'type' => array
  153. (
  154. 'type' => 'int-11',
  155. 'name' => '支付方式',
  156. 'default' => '1',
  157. 'desc' => '支付方式',
  158. 'match' => 'is_numeric',
  159. 'option' => $type,
  160. 'search' => 'select',
  161. 'update' => 'radio',
  162. //'list' => true,
  163. 'control' => 'type',
  164. ),
  165. 'system' => array
  166. (
  167. 'type' => 'int-11',
  168. 'name' => '系统',
  169. 'default' => '1',
  170. 'desc' => '系统',
  171. 'match' => 'is_numeric',
  172. 'option' => $system,
  173. 'search' => 'select',
  174. 'update' => 'radio',
  175. 'list' => true,
  176. ),
  177. 'source' => array
  178. (
  179. 'type' => 'int-11',
  180. 'name' => '渠道来源',
  181. 'default' => '1',
  182. 'desc' => '支付方式',
  183. 'match' => 'is_numeric',
  184. 'option' => $source,
  185. 'search' => 'select',
  186. 'update' => 'radio',
  187. 'list' => true,
  188. ),
  189. 'seller_id' => array
  190. (
  191. 'type' => 'int-11',
  192. 'name' => '销售商',
  193. 'default' => '1',
  194. 'desc' => '销售商',
  195. 'match' => 'is_numeric',
  196. 'update' => 'select',
  197. 'option' => $seller,
  198. 'search' => 'select',
  199. //'list' => true,
  200. ),
  201. 'notice' => array
  202. (
  203. 'type' => 'int-11',
  204. 'name' => '模板消息提醒次数',
  205. 'default' => '0',
  206. 'desc' => '模板消息提醒次数',
  207. 'match' => 'is_numeric',
  208. ),
  209. 'start' => array
  210. (
  211. 'type' => 'int-11',
  212. 'default' => '',
  213. 'name' => '开始时间',
  214. 'match' => 'is_string',
  215. 'desc' => '开始时间',
  216. //'update' => 'date',
  217. //'list' => 'date("Y-m-d H:i:s", {start})',
  218. //'callback' => 'maketime',
  219. ),
  220. 'end' => array
  221. (
  222. 'type' => 'int-11',
  223. 'default' => '',
  224. 'name' => '结束时间',
  225. 'match' => 'is_string',
  226. 'desc' => '结束时间',
  227. //'update' => 'date',
  228. //'list' => 'date("Y-m-d H:i:s", {end})',
  229. //'callback' => 'maketime',
  230. ),
  231. 'cash' => array
  232. (
  233. 'type' => 'varchar-50',
  234. 'name' => '支付金额',
  235. 'default' => '',
  236. 'desc' => '支付金额',
  237. 'match' => 'option',
  238. 'update' => 'text',
  239. //'list' => true,
  240. 'show' => 'type=1',
  241. ),
  242. 'code' => array
  243. (
  244. 'type' => 'varchar-50',
  245. 'name' => '使用的兑换码',
  246. 'default' => '',
  247. 'desc' => '使用的兑换码',
  248. 'match' => 'option',
  249. 'update' => 'text',
  250. //'list' => true,
  251. 'show' => 'type=2',
  252. ),
  253. 'status' => array
  254. (
  255. 'type' => 'tinyint-1',
  256. 'name' => '订单状态',
  257. 'default' => '1',
  258. 'desc' => '请选择订单状态',
  259. 'match' => 'is_numeric',
  260. 'option' => $status,
  261. 'search' => 'select',
  262. 'update' => 'radio',
  263. 'list' => 'Dever::load("vip/lib/manage.showOrderStatus", "{id}")',
  264. 'control' => 'status',
  265. ),
  266. 'tk_time' => array
  267. (
  268. 'type' => 'int-11',
  269. 'name' => '退款时间',
  270. 'default' => '',
  271. 'desc' => '退款时间',
  272. 'match' => 'option',
  273. //'list' => true,
  274. 'show' => 'status=5',
  275. ),
  276. 'tk_admin' => array
  277. (
  278. 'type' => 'int-11',
  279. 'name' => '退款审核人',
  280. 'default' => '1',
  281. 'desc' => '退款审核人',
  282. 'match' => 'option',
  283. //'list' => true,
  284. 'show' => 'status=5',
  285. ),
  286. 'tk_desc' => array
  287. (
  288. 'type' => 'varchar-300',
  289. 'name' => '退款备注',
  290. 'default' => '',
  291. 'desc' => '退款备注',
  292. 'match' => 'option',
  293. 'update' => 'textarea',
  294. //'show' => 'status=5',
  295. ),
  296. 'state' => array
  297. (
  298. 'type' => 'tinyint-1',
  299. 'name' => '状态',
  300. 'default' => '1',
  301. 'desc' => '请选择状态',
  302. 'match' => 'is_numeric',
  303. ),
  304. 'cdate' => array
  305. (
  306. 'type' => 'int-11',
  307. 'name' => '下单时间',
  308. 'match' => array('is_numeric', time()),
  309. 'desc' => '',
  310. # 只有insert时才生效
  311. 'insert' => true,
  312. 'search' => 'date',
  313. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  314. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  315. ),
  316. ),
  317. 'top' => Dever::config('base')->top,
  318. # 增加这个,为了给当前的list增加一个option
  319. 'top_option' => array
  320. (
  321. 'value' => $auth,
  322. 'col' => 'cate_id',
  323. ),
  324. 'manage' => array
  325. (
  326. 'delete' => false,
  327. 'edit' => false,
  328. 'insert' => false,
  329. 'button' => array
  330. (
  331. //'导出订单' => array('location', 'journal/lib/manage.out'),
  332. ),
  333. 'list_button' => array(
  334. //'edit' => array('退款', 'tk_time,tk_desc,tk_admin', '{status} > 1'),
  335. //'delete' => array('删除', '', '{status} == 1'),
  336. ),
  337. ),
  338. 'request' => array
  339. (
  340. ),
  341. );