soft_cash.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. <?php
  2. $status = array
  3. (
  4. 1 => array('name' => '待业务初审', 'style' => 'font-weight:bold;color:#436EEE'),
  5. 2 => array('name' => '待财务终审', 'style' => 'font-weight:bold;color:#436EEE'),
  6. 3 => array('name' => '已完成', 'style' => 'font-weight:bold;color:green'),
  7. 4 => array('name' => '驳回', 'style' => 'font-weight:bold;color:#CD3700'),
  8. 5 => array('name' => '订单取消', 'style' => 'font-weight:bold;color:#CD3700'),
  9. );
  10. $manage_audit = array
  11. (
  12. //1 => '待审核',
  13. 2 => '已审核',
  14. 3 => '已作废',
  15. );
  16. $type = array
  17. (
  18. 1 => '未签署',
  19. 2 => '已签署',
  20. 3 => '已作废',
  21. );
  22. $role = function()
  23. {
  24. $array = array();
  25. $data = Dever::load('setting/lib/manage.role');
  26. if($data)
  27. {
  28. $array += $data;
  29. }
  30. return $array;
  31. };
  32. # 权限设置 1是软件服务费 2是渠道SAAS账户
  33. $search_auth = Dever::input('search_option_dever_auth', 1);
  34. $insert = false;
  35. $col = Dever::input('col');
  36. $button = array();
  37. $excel = false;
  38. $edit = false;
  39. $list_button = array();
  40. if ($search_auth == 1) {
  41. $edit = true;
  42. if (Dever::load('manage/auth')->checkFunc('agent.soft_cash', 'editnew', '新增')) {
  43. $insert = true;
  44. }
  45. if(Dever::load('manage/auth')->checkFunc('agent.soft_cash', 'editSoftcash', '数据导出')){
  46. $excel[] = array('数据导出','软件服务费', 'agent/lib/soft_cash.out_soft_cash');
  47. }
  48. $list_button['edit'] = array('编辑', '', '{status} != 3');
  49. $list_button['list'] = array('查看详情', '"member_prize&project=agent&id={id}&page_type=1&[refer]"');
  50. $list_button['oper'] = array('删除订单', '"agent/lib/soft_cash.setOrderStatus?id={id}&value=4"', '{status} == 4');
  51. } else {
  52. $date = date('Y-m-d H:i:s', time());
  53. Dever::setInput('search_option_end_buy_date', $date);
  54. }
  55. $admin = Dever::load('manage/auth.info');
  56. $admin_auth = false;
  57. if ($admin && $admin['role'] == 24){
  58. $admin_auth = $admin['role'];
  59. }
  60. return array
  61. (
  62. # 表名
  63. 'name' => 'soft_cash',
  64. # 显示给用户看的名称
  65. 'lang' => '软件服务费',
  66. 'menu' => true,
  67. 'config_status' => $status,
  68. 'config_type' => $type,
  69. 'start' => array
  70. (
  71. 'insert' => 'agent/lib/soft_cash.insertSoft',
  72. ),
  73. 'end' => array
  74. (
  75. 'insert' => 'agent/lib/soft_cash.updateSoft',
  76. 'update' => 'agent/lib/soft_cash.updateSoft',
  77. ),
  78. # 数据结构
  79. 'struct' => array
  80. (
  81. 'id' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => 'ID',
  85. 'default' => '',
  86. 'desc' => '',
  87. 'match' => 'is_numeric',
  88. 'search' => 'order',
  89. 'update' => 'hidden',
  90. //'list' => true,
  91. ),
  92. 'mid' => array
  93. (
  94. 'type' => 'int-11',
  95. 'name' => $search_auth == 2 ? '姓名/手机号' : '代理商姓名/手机号',
  96. 'default' => '-1',
  97. 'desc' => '代理商',
  98. 'match' => 'is_string',
  99. // 'update' => 'text',
  100. 'search' => array
  101. (
  102. 'api' => 'agent/member-getSearch',
  103. 'col' => 'col',
  104. 'result' => 'id',
  105. 'search' => 'mid',
  106. ),
  107. 'list' => $search_auth == 2 ? 'Dever::load("agent/member-one#name", {mid})' : ($admin_auth ? 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true,true)' : 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true)'),
  108. 'list_name' => $search_auth == 2 ? '姓名' : '代理商信息',
  109. 'list_order' => $search_auth == 2 ? 1 : 2,
  110. ),
  111. 'mobile' => array
  112. (
  113. 'type' => 'bigint-11',
  114. 'name' => '代理商手机号',
  115. 'default' => '',
  116. 'desc' => '请输入手机号',
  117. 'match' => Dever::rule('mobile'),
  118. 'update' => 'text',
  119. # 绑定js脚本,更新时使用,第一个参数是执行的方式,第二个参数执行的方法,第三个参数是传值。
  120. 'bind' => array('onblur', 'loading', array('url' => Dever::url("lib/soft_cash.search", 'agent'))),
  121. //'search' => 'fulltext',
  122. 'list_name' => '手机号',
  123. 'list' => $search_auth == 2 ? 'Dever::load("agent/member-one#mobile", {mid})' : false,
  124. 'list_order' => 2,
  125. ),
  126. 'order_num' => array
  127. (
  128. 'type' => 'varchar-100',
  129. 'name' => '订单号',
  130. 'default' => '',
  131. 'desc' => '订单号',
  132. 'match' => 'is_string',
  133. // 'update' => 'text',
  134. 'search' => 'fulltext',
  135. 'list_name' => '订单号<br />购买时间<br/>添加时间',
  136. 'list' => $search_auth == 2 ? false : 'Dever::load("agent/lib/soft_cash.soft_show#num",{id})',
  137. 'list_order' => 1,
  138. ),
  139. 'role' => array
  140. (
  141. 'type' => 'int-11',
  142. 'name' => '代理角色',
  143. 'default' => '',
  144. 'desc' => '代理角色',
  145. 'match' => 'is_numeric',
  146. // 'search' => 'select',
  147. // 'update' => 'select',
  148. //'option' => $role,
  149. //'list' => $search_auth == 2 ? false : true,
  150. //'list_name' => '管理员备注',
  151. //'list' => $search_auth == 2 ? false : '{admin_desc}',
  152. ),
  153. 'agreement_id' => array
  154. (
  155. 'type' => 'int-11',
  156. 'name' => '合同',
  157. 'default' => '-1',
  158. 'desc' => '合同',
  159. 'match' => 'is_string',
  160. // 'update' => 'text',
  161. ),
  162. 'cash' => array
  163. (
  164. 'type' => 'decimal-11,2',
  165. 'name' => '软件服务费用',
  166. 'default' => '0',
  167. 'desc' => '费用',
  168. 'match' => 'option',
  169. 'update' => 'text',
  170. 'list_name' => $search_auth == 2 ? '费用' : '软件服务费用',
  171. 'list' => true,
  172. ),
  173. 'price' => array
  174. (
  175. 'type' => 'decimal-11,2',
  176. 'name' => '原始期权价值',
  177. 'default' => '0',
  178. 'desc' => '原始期权价值',
  179. 'match' => 'option',
  180. 'update' => 'text',
  181. 'list_name' => $search_auth == 2 ? '已有用户数' : '原始期权价值',
  182. 'list' => $search_auth == 2 ? 'Dever::load("agent/lib/member.getUserNum", {mid})' : true,
  183. ),
  184. 'pic' => array
  185. (
  186. 'type' => 'text-255',
  187. 'name' => '支付凭证',
  188. 'default' => '',
  189. 'desc' => '多张图片',
  190. 'match' => 'is_string',
  191. 'update' => 'images',
  192. 'key' => '1',
  193. // 'place' => '759*562',
  194. 'list_name' => $search_auth == 2 ? '开户日期' : '支付凭证',
  195. 'list' => $search_auth == 2 ? '{buy_date} ? date("Y-m-d", {buy_date}) : "-"' : false,
  196. ),
  197. 'status' => array
  198. (
  199. 'type' => 'tinyint-1',
  200. 'name' => '订单状态',
  201. 'default' => '2',
  202. 'desc' => '订单状态',
  203. 'match' => 'is_numeric',
  204. // 'update' => 'radio',
  205. 'option' => $status,
  206. 'search' => $search_auth == 2 ? false : 'select',
  207. 'list_name' => $search_auth == 2 ? '状态' : '订单状态',
  208. //'list' => $search_auth == 2 ? true : false,
  209. 'list_order' => 100,
  210. ),
  211. 'audit' => array
  212. (
  213. 'type' => 'int-11',
  214. 'name' => '审核状态',
  215. 'default' => '2',
  216. 'desc' => '审核状态',
  217. 'match' => 'is_numeric',
  218. 'update' => $col ? 'radio' : false,
  219. 'option' => $manage_audit,
  220. 'mul' => true,
  221. 'control' => 'audit',
  222. 'list_name' => $search_auth == 2 ? '签署日期' : '订单状态<br/>合同签署状态<br/>终审时间<br>签署时间',
  223. 'list' => $search_auth == 2 ? '{fdate} ? date("Y-m-d", {fdate}) : "-"' : 'Dever::load("agent/lib/soft_cash.list",{id})',
  224. ),
  225. 'audit_desc' => array
  226. (
  227. 'type' => 'varchar-600',
  228. 'name' => '备注',
  229. 'default' => '',
  230. 'desc' => '审核说明',
  231. 'match' => 'is_string',
  232. 'update' => $col ? 'textarea' : false,
  233. // 'list' => '"{audit_desc}" ? "{audit_desc}" : "-"',
  234. // 'list_order' => 9,
  235. 'show' => 'audit=3',
  236. ),
  237. 'type' => array
  238. (
  239. 'type' => 'tinyint-1',
  240. 'name' => '签署状态',
  241. 'default' => '1',
  242. 'desc' => '合同签署状态',
  243. 'match' => 'is_numeric',
  244. // 'update' => 'radio',
  245. 'option' => $type,
  246. 'search' => 'select',
  247. 'list_name' => $search_auth == 2 ? '状态' : '签署状态',
  248. 'list' => $search_auth == 2 ? true : false,
  249. ),
  250. 'admin_desc' => array
  251. (
  252. 'type' => 'varchar-600',
  253. 'name' => '管理员备注',
  254. 'default' => '',
  255. 'desc' => '管理员备注',
  256. 'match' => 'option',
  257. 'update' => 'textarea',
  258. 'search' => 'exist',
  259. 'exist' => array
  260. (
  261. 'yes|逾期' => '没有包含逾期的订单',
  262. '逾期' => '查找逾期的订单',
  263. ),
  264. 'list' => $search_auth == 2 ? false : true,
  265. ),
  266. 'buy_date' => array
  267. (
  268. 'type' => 'int-11',
  269. 'name' => '购买时间',
  270. 'match' => 'option',
  271. 'default' => '0',
  272. 'desc' => '',
  273. 'match' => 'is_numeric',
  274. 'update' => 'day',
  275. //'search' => 'hidden',
  276. 'search' => 'date',
  277. //'order' => $search_auth == 2 ? 'desc' : false,
  278. 'callback' => 'maketime',
  279. // 'list' => '{buy_date} > 0 ? date("Y-m-d H:i", {buy_date}) : "无"',
  280. ),
  281. 'audit_admin' => array
  282. (
  283. 'type' => 'int-11',
  284. 'name' => '创建人',
  285. 'default' => '-1',
  286. 'match' => 'is_numeric',
  287. 'desc' => '创建人',
  288. // 'update' => 'hidden',
  289. // 'value' => $admin_id,
  290. 'list' => 'Dever::load("agent/lib/soft_cash.admin_name",{audit_admin})',
  291. ),
  292. 'zdate' => array
  293. (
  294. 'type' => 'int-11',
  295. 'name' => '终审时间',
  296. 'default' => '',
  297. 'match' => 'is_numeric',
  298. 'search' => $search_auth == 2 ? false : 'date',
  299. 'desc' => '',
  300. // 'list' => 'date("Y-m-d H:i:s", {zdate})',
  301. ),
  302. 'fdate' => array
  303. (
  304. 'type' => 'int-11',
  305. 'name' => '签署时间',
  306. 'default' => '',
  307. 'match' => 'is_numeric',
  308. 'search' => 'date',
  309. 'desc' => '',
  310. // 'list' => 'date("Y-m-d H:i:s", {zdate})',
  311. ),
  312. 'dever_auth' => array
  313. (
  314. 'name' => '权限查看',
  315. 'default' => '',
  316. 'desc' => '权限查看',
  317. 'match' => 'is_string',
  318. 'search' => 'hidden',
  319. ),
  320. 'state' => array
  321. (
  322. 'type' => 'tinyint-1',
  323. 'name' => '状态',
  324. 'default' => '1',
  325. 'desc' => '请选择状态',
  326. 'match' => 'is_numeric',
  327. ),
  328. 'cdate' => array
  329. (
  330. 'type' => 'int-11',
  331. 'name' => '创建时间',
  332. 'match' => array('is_numeric', time()),
  333. 'desc' => '',
  334. # 只有insert时才生效
  335. 'insert' => true,
  336. // 'search' => 'date',
  337. // 'list' => 'date("Y-m-d H:i:s", {cdate})',
  338. ),
  339. ),
  340. 'alter' => array
  341. (
  342. 10 => array
  343. (
  344. array('update', 'cash', 'cash', 'decimal-11,2 0 软件服务费'),
  345. array('update', 'price', 'price', 'decimal-11,2 0 期权价值'),
  346. ),
  347. 'version' => 10,
  348. ),
  349. 'manage' => array
  350. (
  351. 'insert' => $insert,
  352. 'delete' => false,
  353. 'edit' => false,
  354. 'excel' => $excel,
  355. 'button' => $button,
  356. 'list_button' => $list_button,
  357. // array
  358. // (
  359. // 'list' => array('查看详情', '"member_prize&project=agent&id={id}&page_type=1&[refer]"'),
  360. // 'list1'=> $list['oper'],
  361. // ),
  362. ),
  363. 'request' => array
  364. (
  365. 'getList' => array
  366. (
  367. # 匹配的正则或函数 选填项
  368. 'option' => array
  369. (
  370. // 'main' => 'yes',
  371. 'mobile' => 'yes',
  372. 'state' => 1,
  373. ),
  374. 'order' => array('id' => 'desc'),
  375. 'type' => 'all',
  376. 'col' => '*',
  377. ),
  378. 'getTotal' => array
  379. (
  380. # 匹配的正则或函数 选填项
  381. 'option' => array
  382. (
  383. 'fstart' => array('yes-zdate', '>='),
  384. 'fend' => array('yes-zdate', '<='),
  385. 'status' => array('yes', 'in'),
  386. 'role' =>'yes',
  387. 'mid' => 'yes',
  388. 'state' => 1,
  389. ),
  390. 'type' => 'one',
  391. 'col' => 'sum(cash) as total',
  392. ),
  393. 'getPrice' => array
  394. (
  395. # 匹配的正则或函数 选填项
  396. 'option' => array
  397. (
  398. 'fstart' => array('yes-fdate', '>='),
  399. 'fend' => array('yes-fdate', '<='),
  400. 'status' => array('yes', 'in'),
  401. 'role' =>'yes',
  402. 'mid' => 'yes',
  403. 'state' => 1,
  404. ),
  405. 'type' => 'one',
  406. 'col' => 'sum(price) as total',
  407. ),
  408. 'getSoftCash' => array
  409. (
  410. # 匹配的正则或函数 选填项
  411. 'option' => array
  412. (
  413. 'fstart' => array('yes-zdate', '>='),
  414. 'fend' => array('yes-zdate', '<='),
  415. 'status' => array('yes', 'in'),
  416. 'role' =>'yes',
  417. 'mid' => 'yes',
  418. 'state' => 1,
  419. ),
  420. 'type' => 'one',
  421. 'col' => 'sum(cash) as total',
  422. ),
  423. 'getSoftNoCash' => array
  424. (
  425. # 匹配的正则或函数 选填项
  426. 'option' => array
  427. (
  428. 'fstart' => array('yes-cdate', '>='),
  429. 'fend' => array('yes-cdate', '<='),
  430. 'status' => array('yes', 'in'),
  431. 'state' => 1,
  432. ),
  433. 'type' => 'one',
  434. 'col' => 'sum(cash) as total',
  435. ),
  436. 'getSoftNum' => array
  437. (
  438. # 匹配的正则或函数 选填项
  439. 'option' => array
  440. (
  441. 'fstart' => array('yes-zdate', '>='),
  442. 'fend' => array('yes-zdate', '<='),
  443. 'status' => array('yes','in'),
  444. 'state' => 1,
  445. ),
  446. 'type' => 'count',
  447. 'col' => '*',
  448. ),
  449. 'getSoftNoNum' => array
  450. (
  451. # 匹配的正则或函数 选填项
  452. 'option' => array
  453. (
  454. 'fstart' => array('yes-cdate', '>='),
  455. 'fend' => array('yes-cdate', '<='),
  456. 'status' => array('yes','in'),
  457. 'state' => 1,
  458. ),
  459. 'type' => 'count',
  460. 'col' => '*',
  461. ),
  462. 'getExcelAll' => array
  463. (
  464. # 匹配的正则或函数 选填项
  465. 'option' => array
  466. (
  467. 'fstart' => array('yes-zdate', '>='),
  468. 'fend' => array('yes-zdate', '<='),
  469. 'bstart' => array('yes-buy_date', '>='),
  470. 'bend' => array('yes-buy_date', '<='),
  471. 'start' => array('yes-fdate', '>='),
  472. 'end' => array('yes-fdate', '<='),
  473. 'status' => 'yes',
  474. 'type' => 'yes',
  475. 'state' => 1,
  476. ),
  477. 'type' => 'all',
  478. 'col' => '*',
  479. ),
  480. ),
  481. );