soft_cash.php 14 KB

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