Manage.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <?php
  2. namespace Task\Lib;
  3. use Dever;
  4. class Manage
  5. {
  6. /**
  7. * 获取统计系统
  8. *
  9. * @return mixed
  10. */
  11. public function task($id)
  12. {
  13. $where['state'] = 1;
  14. $where['task_id'] = $id;
  15. $user_task = Dever::db('task/user_task')->total($where);
  16. $user_report = Dever::db('task/user_report')->total($where);
  17. $where['status'] = 1;
  18. $user_report_s1 = Dever::db('task/user_report')->total($where);
  19. $where['status'] = 2;
  20. $user_report_s2 = Dever::db('task/user_report')->total($where);
  21. $where['status'] = 3;
  22. $user_report_s3 = Dever::db('task/user_report')->total($where);
  23. $data['领取人数'] = $user_task;
  24. $data['提交报告数'] = $user_report;
  25. $data['待审核报告'] = $user_report_s1;
  26. $data['审核通过报告'] = $user_report_s2;
  27. $data['审核未通过报告'] = $user_report_s3;
  28. $html = Dever::table($data);
  29. return $html;
  30. }
  31. /**
  32. * 获取报告信息:表格模式
  33. *
  34. * @return mixed
  35. */
  36. public function report($id)
  37. {
  38. $info = Dever::db('task/user_report')->one($id);
  39. $pic = explode(',', $info['pic']);
  40. $info['pic'] = '<ul id="layer-photos-'.$id.'" class="dever-img">';
  41. foreach ($pic as $k => $v) {
  42. $info['pic'] .= '<li style="margin:5px"><img alt="'.$info['username'].'" layer-src="'.$v.'" src="'.$v.'" width="150px" /><br /></li>';
  43. }
  44. $info['pic'] .= '</ul>';
  45. $data['账号名'] = $info['username'];
  46. $data['任务截屏'] = $info['pic'];
  47. $data['链接'] = $info['link'];
  48. $data['文字说明'] = $info['desc'];
  49. $html = Dever::table($data);
  50. return $html;
  51. }
  52. /**
  53. * 获取报告信息:图片模式
  54. *
  55. * @return mixed
  56. */
  57. public function report_photo($data)
  58. {
  59. $pic = explode(',', $data['pic']);
  60. $data['pic'] = array();
  61. foreach ($pic as $k => $v) {
  62. $data['pic'][$k] = array
  63. (
  64. 'index' => $k,
  65. 'src' => $v,
  66. 'show' => $v,
  67. 'name' => $data['username']
  68. );
  69. }
  70. $status = Dever::db('task/user_report')->config['status'];
  71. $score_status = Dever::db('task/user_report')->config['score_status'];
  72. $table['任务'] = Dever::load('task/info-one#name', $data['task_id']);
  73. $table['用户名'] = Dever::load('passport/user-one#username', $data['uid']);
  74. $table['账号名'] = $data['username'];
  75. $table['链接'] = $data['link'];
  76. $table['文字说明'] = $data['desc'];
  77. $table['是否入账'] = $score_status[$data['score_status']];
  78. $table['审核状态'] = $status[$data['status']];
  79. $table['审核说明'] = $data['status_desc'];
  80. $data['desc'] = Dever::table($table);
  81. return $data;
  82. }
  83. /**
  84. * 获取兑现信息:表格模式
  85. *
  86. * @return mixed
  87. */
  88. public function cash($id)
  89. {
  90. $config = Dever::db('main/config')->one();
  91. $info = Dever::db('task/user_cash')->one($id);
  92. $user = Dever::db('task/user_info')->one(array('uid' => $info['uid']));
  93. if ($info['type'] == 1) {
  94. $type = '微信';
  95. $account = $user['wechat'];
  96. } else {
  97. $type = '支付宝';
  98. $account = $user['alipay'];
  99. }
  100. $data['真实姓名'] = $user['truename'];
  101. $data['身份证号'] = $user['card'];
  102. $data['兑现积分'] = $info['score'] . $config['score_name'];
  103. $data['兑换金额'] = $info['cash'] . '元';
  104. $data['兑现类型'] = $type;
  105. $data['兑现账号'] = $account;
  106. $html = Dever::table($data);
  107. return $html;
  108. }
  109. /**
  110. * 获取认证信息:表格模式
  111. *
  112. * @return mixed
  113. */
  114. public function info($id)
  115. {
  116. $info = Dever::db('task/user_info')->one($id);
  117. $data['身份证正面'] = '<img layer-src="'.$info['card_front'].'" src="'.$info['card_front'].'" width="150px" />';
  118. $data['身份证反面'] = '<img layer-src="'.$info['card_end'].'" src="'.$info['card_end'].'" width="150px" />';
  119. $html = Dever::table($data);
  120. return $html;
  121. }
  122. /**
  123. * 报告审核
  124. *
  125. * @return mixed
  126. */
  127. public function report_audit($id, $name, $data)
  128. {
  129. $info = Dever::db('task/user_report')->one($id);
  130. $status = Dever::param('status', $data);
  131. $desc = Dever::param('status_desc', $data);
  132. if ($info && $status == 3) {
  133. $uid = $info['uid'];
  134. $name = '任务报告审核未通过';
  135. $content = '原因:' . $desc;
  136. Dever::load('message/lib/data.push', -1, $uid, $name, $content, 11);
  137. }
  138. }
  139. /**
  140. * 资料审核
  141. *
  142. * @return mixed
  143. */
  144. public function info_audit($id, $name, $data)
  145. {
  146. $info = Dever::db('task/user_info')->one($id);
  147. $status = Dever::param('status', $data);
  148. $desc = Dever::param('status_desc', $data);
  149. if ($info && $status == 3) {
  150. $uid = $info['uid'];
  151. $name = '用户认证未通过';
  152. $content = '原因:' . $desc;
  153. Dever::load('message/lib/data.push', -1, $uid, $name, $content, 11);
  154. }
  155. }
  156. /**
  157. * 提现审核 废弃
  158. *
  159. * @return mixed
  160. */
  161. public function cash_audit($id, $name, $data)
  162. {
  163. $info = Dever::db('task/user_report')->one($id);
  164. $status = Dever::param('status', $data);
  165. $desc = Dever::param('status_desc', $data);
  166. if ($info && $status == 4) {
  167. $uid = $info['uid'];
  168. $name = '提现申请未通过';
  169. $content = '原因:' . $desc;
  170. Dever::load('message/lib/data.push', -1, $uid, $name, $content, 11);
  171. }
  172. }
  173. }