soft_cash.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  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. ),
  151. 'agreement_id' => array
  152. (
  153. 'type' => 'int-11',
  154. 'name' => '合同',
  155. 'default' => '-1',
  156. 'desc' => '合同',
  157. 'match' => 'is_string',
  158. // 'update' => 'text',
  159. ),
  160. 'cash' => array
  161. (
  162. 'type' => 'decimal-11,2',
  163. 'name' => '软件服务费用',
  164. 'default' => '0',
  165. 'desc' => '费用',
  166. 'match' => 'option',
  167. 'update' => 'text',
  168. 'list_name' => $search_auth == 2 ? '费用' : '软件服务费用',
  169. 'list' => true,
  170. ),
  171. 'price' => array
  172. (
  173. 'type' => 'decimal-11,2',
  174. 'name' => '原始期权价值',
  175. 'default' => '0',
  176. 'desc' => '原始期权价值',
  177. 'match' => 'option',
  178. 'update' => 'text',
  179. 'list_name' => $search_auth == 2 ? '已有用户数' : '原始期权价值',
  180. 'list' => $search_auth == 2 ? 'Dever::load("agent/lib/member.getUserNum", {mid})' : true,
  181. ),
  182. 'pic' => array
  183. (
  184. 'type' => 'text-255',
  185. 'name' => '支付凭证',
  186. 'default' => '',
  187. 'desc' => '多张图片',
  188. 'match' => 'is_string',
  189. 'update' => 'images',
  190. 'key' => '1',
  191. // 'place' => '759*562',
  192. 'list_name' => $search_auth == 2 ? '开户日期' : '支付凭证',
  193. 'list' => $search_auth == 2 ? '{buy_date} ? date("Y-m-d", {buy_date}) : "-"' : false,
  194. ),
  195. 'status' => array
  196. (
  197. 'type' => 'tinyint-1',
  198. 'name' => '订单状态',
  199. 'default' => '2',
  200. 'desc' => '订单状态',
  201. 'match' => 'is_numeric',
  202. // 'update' => 'radio',
  203. 'option' => $status,
  204. 'search' => $search_auth == 2 ? false : 'select',
  205. 'list_name' => $search_auth == 2 ? '状态' : '订单状态',
  206. //'list' => $search_auth == 2 ? true : false,
  207. 'list_order' => 100,
  208. ),
  209. 'audit' => array
  210. (
  211. 'type' => 'int-11',
  212. 'name' => '审核状态',
  213. 'default' => '2',
  214. 'desc' => '审核状态',
  215. 'match' => 'is_numeric',
  216. 'update' => $col ? 'radio' : false,
  217. 'option' => $manage_audit,
  218. 'mul' => true,
  219. 'control' => 'audit',
  220. 'list_name' => $search_auth == 2 ? '签署日期' : '订单状态<br/>合同签署状态<br/>终审时间<br>签署时间',
  221. 'list' => $search_auth == 2 ? '{fdate} ? date("Y-m-d", {fdate}) : "-"' : 'Dever::load("agent/lib/soft_cash.list",{id})',
  222. ),
  223. 'audit_desc' => array
  224. (
  225. 'type' => 'varchar-600',
  226. 'name' => '备注',
  227. 'default' => '',
  228. 'desc' => '审核说明',
  229. 'match' => 'is_string',
  230. 'update' => $col ? 'textarea' : false,
  231. // 'list' => '"{audit_desc}" ? "{audit_desc}" : "-"',
  232. // 'list_order' => 9,
  233. 'show' => 'audit=3',
  234. ),
  235. 'type' => array
  236. (
  237. 'type' => 'tinyint-1',
  238. 'name' => '签署状态',
  239. 'default' => '1',
  240. 'desc' => '合同签署状态',
  241. 'match' => 'is_numeric',
  242. // 'update' => 'radio',
  243. 'option' => $type,
  244. 'search' => 'select',
  245. 'list_name' => $search_auth == 2 ? '状态' : '签署状态',
  246. 'list' => $search_auth == 2 ? true : false,
  247. ),
  248. 'admin_desc' => array
  249. (
  250. 'type' => 'varchar-600',
  251. 'name' => '管理员备注',
  252. 'default' => '',
  253. 'desc' => '管理员备注',
  254. 'match' => 'option',
  255. 'update' => 'textarea',
  256. ),
  257. 'buy_date' => array
  258. (
  259. 'type' => 'int-11',
  260. 'name' => '购买时间',
  261. 'match' => 'option',
  262. 'default' => '0',
  263. 'desc' => '',
  264. 'match' => 'is_numeric',
  265. 'update' => 'day',
  266. //'search' => 'hidden',
  267. 'search' => 'date',
  268. //'order' => $search_auth == 2 ? 'desc' : false,
  269. 'callback' => 'maketime',
  270. // 'list' => '{buy_date} > 0 ? date("Y-m-d H:i", {buy_date}) : "无"',
  271. ),
  272. 'audit_admin' => array
  273. (
  274. 'type' => 'int-11',
  275. 'name' => '创建人',
  276. 'default' => '-1',
  277. 'match' => 'is_numeric',
  278. 'desc' => '创建人',
  279. // 'update' => 'hidden',
  280. // 'value' => $admin_id,
  281. 'list' => 'Dever::load("agent/lib/soft_cash.admin_name",{audit_admin})',
  282. ),
  283. 'zdate' => array
  284. (
  285. 'type' => 'int-11',
  286. 'name' => '终审时间',
  287. 'default' => '',
  288. 'match' => 'is_numeric',
  289. 'search' => $search_auth == 2 ? false : 'date',
  290. 'desc' => '',
  291. // 'list' => 'date("Y-m-d H:i:s", {zdate})',
  292. ),
  293. 'fdate' => array
  294. (
  295. 'type' => 'int-11',
  296. 'name' => '签署时间',
  297. 'default' => '',
  298. 'match' => 'is_numeric',
  299. 'search' => 'date',
  300. 'desc' => '',
  301. // 'list' => 'date("Y-m-d H:i:s", {zdate})',
  302. ),
  303. 'dever_auth' => array
  304. (
  305. 'name' => '权限查看',
  306. 'default' => '',
  307. 'desc' => '权限查看',
  308. 'match' => 'is_string',
  309. 'search' => 'hidden',
  310. ),
  311. 'state' => array
  312. (
  313. 'type' => 'tinyint-1',
  314. 'name' => '状态',
  315. 'default' => '1',
  316. 'desc' => '请选择状态',
  317. 'match' => 'is_numeric',
  318. ),
  319. 'cdate' => array
  320. (
  321. 'type' => 'int-11',
  322. 'name' => '创建时间',
  323. 'match' => array('is_numeric', time()),
  324. 'desc' => '',
  325. # 只有insert时才生效
  326. 'insert' => true,
  327. // 'search' => 'date',
  328. // 'list' => 'date("Y-m-d H:i:s", {cdate})',
  329. ),
  330. ),
  331. 'alter' => array
  332. (
  333. 10 => array
  334. (
  335. array('update', 'cash', 'cash', 'decimal-11,2 0 软件服务费'),
  336. array('update', 'price', 'price', 'decimal-11,2 0 期权价值'),
  337. ),
  338. 'version' => 10,
  339. ),
  340. 'manage' => array
  341. (
  342. 'insert' => $insert,
  343. 'delete' => false,
  344. 'edit' => false,
  345. 'excel' => $excel,
  346. 'button' => $button,
  347. 'list_button' => $list_button,
  348. // array
  349. // (
  350. // 'list' => array('查看详情', '"member_prize&project=agent&id={id}&page_type=1&[refer]"'),
  351. // 'list1'=> $list['oper'],
  352. // ),
  353. ),
  354. 'request' => array
  355. (
  356. 'getList' => array
  357. (
  358. # 匹配的正则或函数 选填项
  359. 'option' => array
  360. (
  361. // 'main' => 'yes',
  362. 'mobile' => 'yes',
  363. 'state' => 1,
  364. ),
  365. 'order' => array('id' => 'desc'),
  366. 'type' => 'all',
  367. 'col' => '*',
  368. ),
  369. 'getTotal' => array
  370. (
  371. # 匹配的正则或函数 选填项
  372. 'option' => array
  373. (
  374. 'fstart' => array('yes-fdate', '>='),
  375. 'fend' => array('yes-fdate', '<='),
  376. 'status' => array('yes', 'in'),
  377. 'role' =>'yes',
  378. 'mid' => 'yes',
  379. 'state' => 1,
  380. ),
  381. 'type' => 'one',
  382. 'col' => 'sum(cash) as total',
  383. ),
  384. 'getPrice' => array
  385. (
  386. # 匹配的正则或函数 选填项
  387. 'option' => array
  388. (
  389. 'fstart' => array('yes-fdate', '>='),
  390. 'fend' => array('yes-fdate', '<='),
  391. 'status' => array('yes', 'in'),
  392. 'role' =>'yes',
  393. 'mid' => 'yes',
  394. 'state' => 1,
  395. ),
  396. 'type' => 'one',
  397. 'col' => 'sum(price) as total',
  398. ),
  399. 'getSoftCash' => array
  400. (
  401. # 匹配的正则或函数 选填项
  402. 'option' => array
  403. (
  404. 'fstart' => array('yes-zdate', '>='),
  405. 'fend' => array('yes-zdate', '<='),
  406. 'status' => array('yes', 'in'),
  407. 'role' =>'yes',
  408. 'mid' => 'yes',
  409. 'state' => 1,
  410. ),
  411. 'type' => 'one',
  412. 'col' => 'sum(cash) as total',
  413. ),
  414. 'getSoftNoCash' => array
  415. (
  416. # 匹配的正则或函数 选填项
  417. 'option' => array
  418. (
  419. 'fstart' => array('yes-cdate', '>='),
  420. 'fend' => array('yes-cdate', '<='),
  421. 'status' => array('yes', 'in'),
  422. 'state' => 1,
  423. ),
  424. 'type' => 'one',
  425. 'col' => 'sum(cash) as total',
  426. ),
  427. 'getSoftNum' => array
  428. (
  429. # 匹配的正则或函数 选填项
  430. 'option' => array
  431. (
  432. 'fstart' => array('yes-zdate', '>='),
  433. 'fend' => array('yes-zdate', '<='),
  434. 'status' => array('yes','in'),
  435. 'state' => 1,
  436. ),
  437. 'type' => 'count',
  438. 'col' => '*',
  439. ),
  440. 'getSoftNoNum' => array
  441. (
  442. # 匹配的正则或函数 选填项
  443. 'option' => array
  444. (
  445. 'fstart' => array('yes-cdate', '>='),
  446. 'fend' => array('yes-cdate', '<='),
  447. 'status' => array('yes','in'),
  448. 'state' => 1,
  449. ),
  450. 'type' => 'count',
  451. 'col' => '*',
  452. ),
  453. 'getExcelAll' => array
  454. (
  455. # 匹配的正则或函数 选填项
  456. 'option' => array
  457. (
  458. 'fstart' => array('yes-zdate', '>='),
  459. 'fend' => array('yes-zdate', '<='),
  460. 'bstart' => array('yes-buy_date', '>='),
  461. 'bend' => array('yes-buy_date', '<='),
  462. 'start' => array('yes-fdate', '>='),
  463. 'end' => array('yes-fdate', '<='),
  464. 'status' => 'yes',
  465. 'type' => 'yes',
  466. 'state' => 1,
  467. ),
  468. 'type' => 'all',
  469. 'col' => '*',
  470. ),
  471. ),
  472. );