Manage.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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, '', 1, 'dever-img-' . $id);
  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, '', 1, 'dever-img-' . $data['id']);
  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. $score = Dever::db('task/user_score')->one(array('uid' => $info['uid']));
  93. $user = Dever::db('task/user_info')->one(array('uid' => $info['uid']));
  94. if ($info['type'] == 1) {
  95. $type = '微信';
  96. $account = $user['wechat'];
  97. } else {
  98. $type = '支付宝';
  99. $account = $user['alipay'];
  100. }
  101. $data['真实姓名'] = $user['truename'];
  102. $data['身份证号'] = $user['card'];
  103. $data['兑现积分'] = $info['score'] . $config['score_name'];
  104. $data['兑换金额'] = $info['cash'] . '元';
  105. $data['兑现类型'] = $type;
  106. $data['兑现账号'] = $account;
  107. $data['剩余积分'] = $score['score'] . $config['score_name'];
  108. $html = Dever::table($data);
  109. return $html;
  110. }
  111. /**
  112. * 获取认证信息:表格模式
  113. *
  114. * @return mixed
  115. */
  116. public function info($id)
  117. {
  118. $info = Dever::db('task/user_info')->one($id);
  119. $data['身份证正面'] = '<img layer-src="'.$info['card_front'].'" src="'.$info['card_front'].'" width="150px" />';
  120. $data['身份证反面'] = '<img layer-src="'.$info['card_end'].'" src="'.$info['card_end'].'" width="150px" />';
  121. $html = Dever::table($data, '', 1, 'dever-img-' . $id);
  122. return $html;
  123. }
  124. /**
  125. * 报告审核
  126. *
  127. * @return mixed
  128. */
  129. public function report_audit($id, $name, $data)
  130. {
  131. $info = Dever::db('task/user_report')->one($id);
  132. $status = Dever::param('status', $data);
  133. $desc = Dever::param('status_desc', $data);
  134. if ($info && $status == 3) {
  135. $uid = $info['uid'];
  136. $name = '任务报告审核未通过';
  137. $content = '原因:' . $desc;
  138. Dever::load('message/lib/data.push', -1, $uid, $name, $content, 11);
  139. }
  140. }
  141. /**
  142. * 资料审核
  143. *
  144. * @return mixed
  145. */
  146. public function info_audit($id, $name, $data)
  147. {
  148. $info = Dever::db('task/user_info')->one($id);
  149. $status = Dever::param('status', $data);
  150. $desc = Dever::param('status_desc', $data);
  151. if ($info && $status == 3) {
  152. $uid = $info['uid'];
  153. $name = '用户认证未通过';
  154. $content = '原因:' . $desc;
  155. Dever::load('message/lib/data.push', -1, $uid, $name, $content, 11);
  156. }
  157. }
  158. /**
  159. * 提现审核 废弃
  160. *
  161. * @return mixed
  162. */
  163. public function cash_audit($id, $name, $data)
  164. {
  165. $info = Dever::db('task/user_report')->one($id);
  166. $status = Dever::param('status', $data);
  167. $desc = Dever::param('status_desc', $data);
  168. if ($info && $status == 4) {
  169. $uid = $info['uid'];
  170. $name = '提现申请未通过';
  171. $content = '原因:' . $desc;
  172. Dever::load('message/lib/data.push', -1, $uid, $name, $content, 11);
  173. }
  174. }
  175. }