123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- <?php
- namespace Task\Lib;
- use Dever;
- class Manage
- {
- /**
- * 获取统计系统
- *
- * @return mixed
- */
- public function task($id)
- {
- $where['state'] = 1;
- $where['task_id'] = $id;
- $user_task = Dever::db('task/user_task')->total($where);
- $user_report = Dever::db('task/user_report')->total($where);
- $where['status'] = 1;
- $user_report_s1 = Dever::db('task/user_report')->total($where);
- $where['status'] = 2;
- $user_report_s2 = Dever::db('task/user_report')->total($where);
- $where['status'] = 3;
- $user_report_s3 = Dever::db('task/user_report')->total($where);
-
- $data['领取人数'] = $user_task;
- $data['提交报告数'] = $user_report;
- $data['待审核报告'] = $user_report_s1;
- $data['审核通过报告'] = $user_report_s2;
- $data['审核未通过报告'] = $user_report_s3;
- $html = Dever::table($data);
- return $html;
- }
- /**
- * 获取报告信息:表格模式
- *
- * @return mixed
- */
- public function report($id)
- {
- $info = Dever::db('task/user_report')->one($id);
- $pic = explode(',', $info['pic']);
- $info['pic'] = '<ul id="layer-photos-'.$id.'" class="dever-img">';
- foreach ($pic as $k => $v) {
- $info['pic'] .= '<li style="margin:5px"><img alt="'.$info['username'].'" layer-src="'.$v.'" src="'.$v.'" width="150px" /><br /></li>';
- }
- $info['pic'] .= '</ul>';
-
- $data['账号名'] = $info['username'];
- $data['任务截屏'] = $info['pic'];
- $data['链接'] = $info['link'];
- $data['文字说明'] = $info['desc'];
- $html = Dever::table($data, '', 1, 'dever-img-' . $id);
- return $html;
- }
- /**
- * 获取报告信息:图片模式
- *
- * @return mixed
- */
- public function report_photo($data)
- {
- $pic = explode(',', $data['pic']);
- $data['pic'] = array();
- foreach ($pic as $k => $v) {
- $data['pic'][$k] = array
- (
- 'index' => $k,
- 'src' => $v,
- 'show' => $v,
- 'name' => $data['username']
- );
- }
- $status = Dever::db('task/user_report')->config['status'];
- $score_status = Dever::db('task/user_report')->config['score_status'];
- $table['任务'] = Dever::load('task/info-one#name', $data['task_id']);
- $table['用户名'] = Dever::load('passport/user-one#username', $data['uid']);
- $table['账号名'] = $data['username'];
- $table['链接'] = $data['link'];
- $table['文字说明'] = $data['desc'];
- $table['是否入账'] = $score_status[$data['score_status']];
- $table['审核状态'] = $status[$data['status']];
- $table['审核说明'] = $data['status_desc'];
- $data['desc'] = Dever::table($table, '', 1, 'dever-img-' . $data['id']);
- return $data;
- }
- /**
- * 获取兑现信息:表格模式
- *
- * @return mixed
- */
- public function cash($id)
- {
- $config = Dever::db('main/config')->one();
- $info = Dever::db('task/user_cash')->one($id);
- $score = Dever::db('task/user_score')->one(array('uid' => $info['uid']));
- $user = Dever::db('task/user_info')->one(array('uid' => $info['uid']));
- if ($info['type'] == 1) {
- $type = '微信';
- $account = $user['wechat'];
- } else {
- $type = '支付宝';
- $account = $user['alipay'];
- }
- $data['真实姓名'] = $user['truename'];
- $data['身份证号'] = $user['card'];
- $data['兑现积分'] = $info['score'] . $config['score_name'];
- $data['兑换金额'] = $info['cash'] . '元';
- $data['兑现类型'] = $type;
- $data['兑现账号'] = $account;
- $data['剩余积分'] = $score['score'] . $config['score_name'];
- $html = Dever::table($data);
- return $html;
- }
- /**
- * 获取认证信息:表格模式
- *
- * @return mixed
- */
- public function info($id)
- {
- $info = Dever::db('task/user_info')->one($id);
-
- $data['身份证正面'] = '<img layer-src="'.$info['card_front'].'" src="'.$info['card_front'].'" width="150px" />';
- $data['身份证反面'] = '<img layer-src="'.$info['card_end'].'" src="'.$info['card_end'].'" width="150px" />';
- $html = Dever::table($data, '', 1, 'dever-img-' . $id);
- return $html;
- }
- /**
- * 报告审核
- *
- * @return mixed
- */
- public function report_audit($id, $name, $data)
- {
- $info = Dever::db('task/user_report')->one($id);
- $status = Dever::param('status', $data);
- $desc = Dever::param('status_desc', $data);
- if ($info && $status == 3) {
- $uid = $info['uid'];
- $name = '任务报告审核未通过';
- $content = '原因:' . $desc;
- Dever::load('message/lib/data.push', -1, $uid, $name, $content, 11);
- }
- }
- /**
- * 资料审核
- *
- * @return mixed
- */
- public function info_audit($id, $name, $data)
- {
- $info = Dever::db('task/user_info')->one($id);
- $status = Dever::param('status', $data);
- $desc = Dever::param('status_desc', $data);
- if ($info && $status == 3) {
- $uid = $info['uid'];
- $name = '用户认证未通过';
- $content = '原因:' . $desc;
- Dever::load('message/lib/data.push', -1, $uid, $name, $content, 11);
- }
- }
- /**
- * 提现审核 废弃
- *
- * @return mixed
- */
- public function cash_audit($id, $name, $data)
- {
- $info = Dever::db('task/user_report')->one($id);
- $status = Dever::param('status', $data);
- $desc = Dever::param('status_desc', $data);
- if ($info && $status == 4) {
- $uid = $info['uid'];
- $name = '提现申请未通过';
- $content = '原因:' . $desc;
- Dever::load('message/lib/data.push', -1, $uid, $name, $content, 11);
- }
- }
- }
|