soft_cash.php 14 KB

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