Manage.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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. $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. $data['剩余积分'] = ($score['score'] - $info['score']) . $config['score_name'];
  109. $html = Dever::table($data);
  110. return $html;
  111. }
  112. /**
  113. * 获取认证信息:表格模式
  114. *
  115. * @return mixed
  116. */
  117. public function info($id)
  118. {
  119. $info = Dever::db('task/user_info')->one($id);
  120. $data['身份证正面'] = '<img layer-src="'.$info['card_front'].'" src="'.$info['card_front'].'" width="150px" />';
  121. $data['身份证反面'] = '<img layer-src="'.$info['card_end'].'" src="'.$info['card_end'].'" width="150px" />';
  122. $html = Dever::table($data);
  123. return $html;
  124. }
  125. /**
  126. * 报告审核
  127. *
  128. * @return mixed
  129. */
  130. public function report_audit($id, $name, $data)
  131. {
  132. $info = Dever::db('task/user_report')->one($id);
  133. $status = Dever::param('status', $data);
  134. $desc = Dever::param('status_desc', $data);
  135. if ($info && $status == 3) {
  136. $uid = $info['uid'];
  137. $name = '任务报告审核未通过';
  138. $content = '原因:' . $desc;
  139. Dever::load('message/lib/data.push', -1, $uid, $name, $content, 11);
  140. }
  141. }
  142. /**
  143. * 资料审核
  144. *
  145. * @return mixed
  146. */
  147. public function info_audit($id, $name, $data)
  148. {
  149. $info = Dever::db('task/user_info')->one($id);
  150. $status = Dever::param('status', $data);
  151. $desc = Dever::param('status_desc', $data);
  152. if ($info && $status == 3) {
  153. $uid = $info['uid'];
  154. $name = '用户认证未通过';
  155. $content = '原因:' . $desc;
  156. Dever::load('message/lib/data.push', -1, $uid, $name, $content, 11);
  157. }
  158. }
  159. /**
  160. * 提现审核 废弃
  161. *
  162. * @return mixed
  163. */
  164. public function cash_audit($id, $name, $data)
  165. {
  166. $info = Dever::db('task/user_report')->one($id);
  167. $status = Dever::param('status', $data);
  168. $desc = Dever::param('status_desc', $data);
  169. if ($info && $status == 4) {
  170. $uid = $info['uid'];
  171. $name = '提现申请未通过';
  172. $content = '原因:' . $desc;
  173. Dever::load('message/lib/data.push', -1, $uid, $name, $content, 11);
  174. }
  175. }
  176. }