Merge branch 'feature/fix_work_order' of wmtx/platform into release

工单统计及iOS下载数优化
master
廖金灵 5 years ago committed by Gogs
commit 8b2ae9d6da

@ -8983,6 +8983,7 @@ class ExportController extends Controller
array('status','状态'),
array('user_account','游戏账号'),
array('creator','创单人'),
array('handler','创单人'),
array('created_time', '创单时间'),
array('score', '分数'),
array('attachment_type', '附件')
@ -8994,6 +8995,7 @@ class ExportController extends Controller
$item['type'] = $item['type'] == 1 ? '资源' : '反馈';
$item['status'] = $item['status'] == 1 ? '完成' : '处理中';
$item['creator'] = get_admin_name($item['creator_id']);
$item['handler'] = get_admin_name($item['handler_id']);
$item['created_time'] = date('Y-m-d H:i:s', $item['created_time']);
$item['attachment_type'] = empty($item['attachment_url']) ? '无' : '有';
$item['order_no'] = "\t{$item['order_no']}";
@ -9035,13 +9037,17 @@ class ExportController extends Controller
$pdlMap .= " and pdl.create_time < {$endTime}";
}
if ($info['level'] == PromoteModel::LEVEL_GROUP_LEADER) {
if ($level == PromoteModel::LEVEL_TEAM_MEMBER) {
$beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y"));
$endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
$xlsData = M('promote', 'tab_')->alias('p')
->field('p.id, p.level, p.account, count(pdl.id) as lowerCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->field('p.id, p.level, p.account, count(u.id) as iosCount, count(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null)) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left')
->join("tab_user u on u.promote_id = p.id and u.device_type=2", 'left')
->where($map)
->group('p.id')
->select();
->select();
} else {
$xlsData = M('promote', 'tab_')->alias('p')
->field('p.id, p.level, p.account, count(if(p2.level = '.($level+1).', 1, null)) as lowerCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
@ -9051,14 +9057,28 @@ class ExportController extends Controller
->group('p.id')
->select();
}
$xlsCell = array(
array('account', PromoteModel::$levelArr[$level]."账号"),
array('lowercount', PromoteModel::$levelArr[$level+1]."数量"),
array('tfcount', 'TF下载数'),
array('supersigncount', "超级签下载数"),
array('signcount', "企业签下载数"),
);
if ($level == PromoteModel::LEVEL_TEAM_MEMBER) {
foreach($xlsData as &$item) {
$item['tfcount'] = $item['tfcount'] . "(" . (empty($item['ioscount']) ? 0 : round( ($item['tfcount'] / $item['ioscount']) * 100 , 2)) . ")%";
}
$xlsCell = array(
array('account', PromoteModel::$levelArr[$level]."账号"),
array('ioscount', "iOS用户总数"),
array('weekcount', "新增iOS用户总数"),
array('tfcount', 'TF下载数/iOS用户总数'),
array('supersigncount', "超级签下载数"),
array('signcount', "企业签下载数"),
);
} else {
$xlsCell = array(
array('account', PromoteModel::$levelArr[$level]."账号"),
array('lowercount', PromoteModel::$levelArr[$level+1]."数量"),
array('tfcount', 'TF下载数'),
array('supersigncount', "超级签下载数"),
array('signcount', "企业签下载数"),
);
}
$this->exportAddOperationLog('Statistics/packDownload','统计-IOS下载统计-导出');
$this->exportExcel($xlsName, $xlsCell, $xlsData);
}
@ -9157,4 +9177,86 @@ class ExportController extends Controller
$this->exportExcel($xlsName, $xlsCell, $list);
}
public function exportWorkOrderStatistics()
{
$order = '';
if ($_REQUEST['data_order'] != '') {
$data_order = reset(explode(',', $_REQUEST['data_order']));
$data_order_type = end(explode(',', $_REQUEST['data_order']));
$this->assign('userarpu_order', $data_order);
$this->assign('userarpu_order_type', $data_order_type);
$order = 'order by ' . $data_order_type . " " . ($data_order == 3 ? 'desc' : 'asc');
}
$map = '1=1';
if (!empty(I('nickname'))) {
$map .= " and t.nickname = '" . I('nickname') . "'";
}
// 获取所有传单或者接单用户id
$userids = M('work_order_info', 'tab_')
->field("concat(creator_id, ',', handler_id) as userid")
->join('sys_member as t on creator_id = t.uid or handler_id = t.uid')
->where($map)
->select();
if (empty($userids)) {
$list = [];
$count = 0;
} else {
$userids = implode(',', array_unique(array_filter(explode(',', implode(',', array_column($userids, 'userid'))))));
$count = count($userids);
$list = M('work_order_info', 'tab_')->query("SELECT
t.id,
t.nickname,
sum(total_create_count) as total_create_count,
sum(total_accepted_count) as total_accepted_count,
sum(total_handle_count) as total_handle_count,
sum(total_complete_count) as total_complete_count
FROM
(
SELECT
u.uid as id,
u.nickname,
count(*) AS total_create_count,
count(
IF (i.`handler_id` > 0, 1, NULL)
) AS total_accepted_count,
NULL AS total_handle_count,
NULL AS total_complete_count
FROM
sys_member u
LEFT JOIN tab_work_order_info i ON i.creator_id = u.uid
WHERE
u.uid in ({$userids})
GROUP BY u.uid
UNION
SELECT
u.uid as id,
u.nickname,
NULL AS total_create_count,
NULL AS total_accepted_count,
count(*) AS total_handle_count,
count(IF(i.`status` = 1, 1, NULL)) AS total_complete_count
FROM
sys_member u
JOIN tab_work_order_info i ON i.handler_id = u.uid
WHERE
u.uid in ({$userids})
GROUP BY u.uid
) AS t
where {$map}
GROUP BY t.id
$order");
}
$xlsName = '工单统计报表';
$xlsCell = array(
array('nickname', "账号"),
array('total_create_count', "发布工单数"),
array('total_accepted_count', '被接手工单数'),
array('total_handle_count', "接手工单数"),
array('total_complete_count', "完成工单数"),
);
$this->exportAddOperationLog('Statistics/exportWorkOrderStatistics','用户-工单统计-导出');
$this->exportExcel($xlsName, $xlsCell, $list);
}
}

@ -1172,17 +1172,22 @@ class StatisticsController extends ThinkController {
$pdlMap .= " and pdl.create_time < {$endTime}";
}
if ($info['level'] == PromoteModel::LEVEL_GROUP_LEADER) {
if ($level == PromoteModel::LEVEL_TEAM_MEMBER) {
$beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y"));
$endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
$list = M('promote', 'tab_')->alias('p')
->field('p.id, p.level, p.account, count(pdl.id) as lowerCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->field('p.id, p.level, p.account, count(u.id) as iosCount, count(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null)) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left')
->join("tab_user u on u.promote_id = p.id and u.device_type=2", 'left')
->where($map)
->page($p, $row)
->group('p.id')
->select();
$total = M('promote', 'tab_')->alias('p')
->field('count(pdl.id) as lowerCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->field('count(distinct(u.id)) as iosCount, count(distinct(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null))) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left')
->join("tab_user u on u.promote_id = p.id and u.device_type=2")
->where($map)
->select();
} else {
@ -1263,8 +1268,10 @@ class StatisticsController extends ThinkController {
->page($p, $row)
->select();
$beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y"));
$endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
$total = M('package_download_log', 'tab_')->alias('pdl')
->field('count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->field('count(distinct(if(u.device_type=2, 1, null))) as iosCount, count(distinct(if (u.device_type=2 and u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null))) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->join('tab_promote p on p.id = pdl.promote_id')
->join('tab_user u on u.id = pdl.user_id', 'left')
->where($map)

@ -103,7 +103,7 @@ class WorkOrderController extends ThinkController
$info['role_name'] = I('role_names')[$i];
$info['resource_num'] = I('apply_resources')[$i];
$info['order_no'] = $info['type'] . date('YmdHis'). $i. rand(10, 99) . $info['creator_id'];
$info['handler_id'] = $info['creator_id'];
//$info['handler_id'] = $info['creator_id'];
$ins = M('work_order_info', 'tab_')->add($info);
if (!$ins) {M('work_order_info', 'tab_')->rollback(); $this->error("创建失败");}
@ -113,7 +113,7 @@ class WorkOrderController extends ThinkController
// 添加一条附件信息
$attachement_info = $data;
$attachement_info['attachment_url'] = I('attachment_url', '');
$attachement_info['handler_id'] = $attachement_info['creator_id'];
//$attachement_info['handler_id'] = $attachement_info['creator_id'];
$attachement_info['order_no'] = $attachement_info['type'] . date('YmdHis'). rand(100, 999) . $attachement_info['creator_id'];
$ins = M('work_order_info', 'tab_')->add($attachement_info);
if (!$ins) {M('work_order_info', 'tab_')->rollback(); $this->error("创建失败");}
@ -126,16 +126,16 @@ class WorkOrderController extends ThinkController
if (empty(I('user_account')) || empty(I('role_name')) || empty(I('feedback'))) {
$this->error('请填写必填的数据');
}
if (empty('handler_id')) {
$this->error('请选择处理人');
}
// if (empty('handler_id')) {
// $this->error('请选择处理人');
// }
$user = M('user', 'tab_')->where(['account'=>I('user_account')])->find();
if (empty($user)) $this->error("账号不存在");
$data['attachment_url'] = I('attachment_url', '');
$data['user_account'] = I('user_account');
$data['role_name'] = I('role_name');
$data['feedback'] = I('feedback');
$data['handler_id'] = I('handler_id');
//$data['handler_id'] = I('handler_id');
$data['remark'] = I('remark', '');
$data['process_log'] = json_encode([['title'=>sprintf('%s于 %s 创建了工单%s,工单状态处理中。', get_admin_name($data['creator_id']), date('Y-m-d H:i:s'), $data['order_no']), 'type'=>1]]);
$ins = M('work_order_info', 'tab_')->add($data);
@ -203,7 +203,7 @@ class WorkOrderController extends ThinkController
private function modifyProcessLog($oldData, $newData)
{
$key = ['game_name'=>'游戏名称', 'server_name'=>'区服名称', 'role_name'=>'角色名称', 'user_account'=>'玩家账号', 'feedback'=>'反馈原因', 'handler_id'=>'处理人', 'remark'=>'备注', 'status'=>'状态', 'attachment_url'=>'附件'];
$key = ['game_name'=>'游戏名称', 'server_name'=>'区服名称', 'role_name'=>'角色名称', 'user_account'=>'玩家账号', 'feedback'=>'反馈原因', 'handler_id'=>'接单人员', 'remark'=>'备注', 'status'=>'状态', 'attachment_url'=>'附件'];
$log = [];
foreach ($newData as $k => $v) {
if (array_key_exists($k, $oldData) && array_key_exists($k, $key) && $oldData[$k] != $newData[$k]) {
@ -254,7 +254,7 @@ class WorkOrderController extends ThinkController
if (!I('resource_num')) $this->error('请填写申请资源数量');
}
$data['handler_id'] = $data['creator_id'] = is_login();
$data['creator_id'] = is_login();
$data['created_time'] = time();
$data['type'] = $info['type'];
$data['server_id'] = $info['server_id'];
@ -314,7 +314,7 @@ class WorkOrderController extends ThinkController
// 删除
public function delete($ids)
{
$delete = M('work_order_info', 'tab_')->where(['id'=>['in', $ids]])->save(['status'=>2]);
$delete = M('work_order_info', 'tab_')->where(['id'=>['in', $ids]])->delete();
return $delete ? $this->success('删除成功') : $this->error('删除失败');
}
@ -329,4 +329,109 @@ class WorkOrderController extends ThinkController
$delete = M('work_order_info', 'tab_')->where(['id'=>$id])->save($data);
return $delete ? $this->success('成功完成工单') : $this->error('更新失败');
}
public function take($id)
{
$info = M('work_order_info', 'tab_')->where(['id'=>$id])->find();
if (empty($info)) $this->error('未找到该资源');
$userid = is_login();
if ($info['status'] == 1) {
$this->error('工单已完成');
}
if (!empty($info['handler_id'])) {
if ($info['handler_id'] != $userid) {
$this->error('工单已被他人领取');
} else {
$this->error('请勿重复领取工单');
}
}
if ($info['type'] == 2) {
$process_log = json_decode($info['process_log'], true) ?: [];
$log = ['title'=>sprintf("%s于%s 接取了工单%s", get_admin_name(is_login()), date('Y-m-d H:i:s'), $info['order_no']), 'detail'=>$log, 'type'=>2];
$data['process_log'] = json_encode(array_merge($process_log, [$log]));
}
$data['handler_id'] = $userid;
$upt = M('work_order_info', 'tab_')->where(['id'=>$id])->save($data);
return $upt ? $this->success('成功接取工单') : $this->error('接单失败');
}
public function statistics($row = 10, $p = 1)
{
$limit = ($p-1)*$row . ", {$row}";
$order = '';
if ($_REQUEST['data_order'] != '') {
$data_order = reset(explode(',', $_REQUEST['data_order']));
$data_order_type = end(explode(',', $_REQUEST['data_order']));
$this->assign('userarpu_order', $data_order);
$this->assign('userarpu_order_type', $data_order_type);
$order = 'order by ' . $data_order_type . " " . ($data_order == 3 ? 'desc' : 'asc');
}
$map = '1=1';
if (!empty(I('nickname'))) {
$map .= " and t.nickname = '" . I('nickname') . "'";
}
// 获取所有传单或者接单用户id
$userids = M('work_order_info', 'tab_')
->field("concat(creator_id, ',', handler_id) as userid")
->join('sys_member as t on creator_id = t.uid or handler_id = t.uid')
->where($map)
->select();
if (empty($userids)) {
$list = [];
$count = 0;
} else {
$userids = implode(',', array_unique(array_filter(explode(',', implode(',', array_column($userids, 'userid'))))));
$count = count($userids);
$list = M('work_order_info', 'tab_')->query("SELECT
t.id,
t.nickname,
sum(total_create_count) as total_create_count,
sum(total_accepted_count) as total_accepted_count,
sum(total_handle_count) as total_handle_count,
sum(total_complete_count) as total_complete_count
FROM
(
SELECT
u.uid as id,
u.nickname,
count(*) AS total_create_count,
count(
IF (i.`handler_id` > 0, 1, NULL)
) AS total_accepted_count,
NULL AS total_handle_count,
NULL AS total_complete_count
FROM
sys_member u
LEFT JOIN tab_work_order_info i ON i.creator_id = u.uid
WHERE
u.uid in ({$userids})
GROUP BY u.uid
UNION
SELECT
u.uid as id,
u.nickname,
NULL AS total_create_count,
NULL AS total_accepted_count,
count(*) AS total_handle_count,
count(IF(i.`status` = 1, 1, NULL)) AS total_complete_count
FROM
sys_member u
JOIN tab_work_order_info i ON i.handler_id = u.uid
WHERE
u.uid in ({$userids})
GROUP BY u.uid
) AS t
where {$map}
GROUP BY t.id
$order
limit {$limit}");
}
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
}
$this->assign('list_data', $list);
$this->display('statistics');
}
}

@ -80,8 +80,14 @@
<input class="check-all" type="checkbox">
</th> -->
<th>{$level_desc}账号</th>
<?php if($level < 4):?>
<th>{$level_low_desc}数量</th>
<th>TF下载数</th>
<?php else:?>
<th>iOS用户总数</th>
<th>新增iOS用户总数</th>
<th>TF下载数</th>
<?php endif;?>
<th>超级签下载数</th>
<th>企业签下载数</th>
<th>操作</th>
@ -96,8 +102,15 @@
<tr>
<!-- <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids"></td> -->
<td>{$data.account}</td>
<?php if($data['level'] < 4):?>
<td>{$data.lowercount}</td>
<td >{$data.tfcount}</td>
<?php else:?>
<td>{$data.ioscount}</td>
<td>{$data.weekcount}</td>
<td >{$data.tfcount}(<?php echo $data['ioscount'] ? round( ($data['tfcount']/$data['ioscount']) * 100, 2) : 0?>%)</td>
<?php endif;?>
<td>{$data.supersigncount}</td>
<td>{$data.signcount}</td>
<td>
@ -112,8 +125,14 @@
<tr>
<!-- <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids"></td> -->
<td>汇总</td>
<?php if($level < 4):?>
<td>{$total[0]['lowercount']}</td>
<td >{$total[0]['tfcount']}</td>
<?php else:?>
<td>{$total[0]['ioscount']}</td>
<td>{$total[0]['weekcount']}</td>
<td >{$total[0]['tfcount']}(<?php echo $total[0]['ioscount'] ? round( ($total[0]['tfcount']/$total[0]['ioscount']) * 100, 2) : 0?>%)</td>
<?php endif;?>
<td>{$total[0]['supersigncount']}</td>
<td>{$total[0]['signcount']}</td>
<td>

@ -133,7 +133,7 @@
<tr>
<!-- <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids"></td> -->
<td>汇总</td>
<td colspan="8" style="text-align: left;">TF下载{$total[0]['tfcount']} 超级签下载:{$total[0]['supersigncount']} 企业签下载:{$total[0]['signcount']}</td>
<td colspan="8" style="text-align: left;">iOS用户总数:{$total[0]['ioscount']}&nbsp;&nbsp;新增iOS用户总数:{$total[0]['weekcount']}&nbsp;&nbsp;TF下载(TF下载/iOS用户总数){$total[0]['tfcount']}(<?php echo $total[0]['ioscount'] ? round( ($total[0]['tfcount']/$total[0]['ioscount']) * 100, 2) : 0?>%) &nbsp;&nbsp;&nbsp;&nbsp;超级签下载:{$total[0]['supersigncount']}&nbsp;&nbsp;企业签下载:{$total[0]['signcount']}</td>
</tr>
</empty>
</tbody>

@ -71,7 +71,7 @@
</td>
</tr>
<tr>
<td class="l noticeinfo">处理人</td>
<td class="l noticeinfo">接单人员</td>
<td class="r table_radio">
<label>{:get_admin_name($data['handler_id'])}</label>
</td>

@ -69,7 +69,7 @@
</td>
</tr>
<tr>
<td class="l noticeinfo">处理人</td>
<td class="l noticeinfo">接单人员</td>
<td class="r table_radio">
<label>{:get_admin_name($data['handler_id'])}</label>
</td>

@ -98,7 +98,7 @@
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="handler_id" name="handler_id" class="select_gallery">
<option value="">单人员选择</option>
<option value="">单人员选择</option>
<?php foreach ($admin_users as $user):?>
<option value="{$user['uid']}" <?php if ($user['uid'] == I('handler_id')):?>selected<?php endif;?> >{$user.nickname}</option>
<?php endforeach;?>
@ -156,6 +156,7 @@
<th>状态</th>
<th>游戏账号</th>
<th>创单人员</th>
<th>接单人员</th>
<th>创建时间</th>
<th>评价分数</th>
<th>附件</th>
@ -177,12 +178,14 @@
<td>{$data.status_desc}</td>
<td>{$data.user_account}</td>
<td>{:get_admin_nickname($data['creator_id'])}</td>
<td>{:get_admin_nickname($data['handler_id'])}</td>
<td>{$data.created_time|date='Y-m-d H:i:s',###}</td>
<td>{$data.score}</td>
<td><?php echo $data['attachment_url'] ? '有' : '无'?></td>
<td>
<a href="{:U('workOrder/modify',array('id'=>$data['id']))}">编辑 </a>
<?php if ($data['type'] == 1):?><a href="{:U('workOrder/resourceApply',array('id'=>$data['id']))}">申请 </a><?php endif;?>
<?php if ($data['status'] != 1 && empty($data['handler_id'])):?><a class="ajax-get" href="{:U('workOrder/take',array('id'=>$data['id']))}">接单 </a><?php endif;?>
<?php if ($data['type'] == 2):?><a href="{:U('workOrder/feedbackProcessLogStore',array('id'=>$data['id']))}">更新 </a><?php endif;?>
<?php if ($data['status'] != 1):?><a class="ajax-get" href="{:U('workOrder/finish',array('id'=>$data['id']))}">完成</a><?php endif;?>
<a href="{:U('workOrder/evaluate',array('id'=>$data['id']))}">评价 </a>

@ -102,6 +102,27 @@
<if condition="$data['server_name'] neq ''"><option value="{$data['server_name']}">{$data['server_name']}</option></if>
</select>
</div>
<?php if ($data['type'] == 1): ?>
<div class="input-list search-title-box">
<label>状态选择:</label>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="" name="resource[status]" class="select_gallery" style="width:120px;">
<option value="1" <?php if ($data['status'] == 1):?>selected<?php endif;?>>完成</option>
<option value="3" <?php if ($data['status'] == 3):?>selected<?php endif;?>>处理中</option>
</select>
</div>
<div class="input-list search-title-box">
<label>接单人员</label>
</div>
<div class="input-list input-list-server search_label_rehab">
<select name="resource[handler_id]" id="handler_id">
<?php foreach ($admin_users as $user):?>
<option value="{$user['uid']}"<?php if ($user['uid'] == $data['handler_id']):?>selected<?php endif;?> >{$user.nickname}</option>
<?php endforeach;?>
</select>
</div>
<?php endif;?>
<?php if (!empty($data['attachment_url']) || $data['type'] == 2):?>
<div class="input-list">
<div id="uploader" class="wu-example">
@ -209,7 +230,7 @@
</td>
</tr>
<tr>
<td class="l noticeinfo">处理人</td>
<td class="l noticeinfo">接单人员</td>
<td class="r table_radio">
<span class="form_select"><select name="feedback[handler_id]" id="handler_id">
<?php foreach ($admin_users as $user):?>

@ -0,0 +1,293 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css"/>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red}
.butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
.butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
.butnbox .butnlist .butn.last {background:#009900;}
.butnbox .butnlist .butn~.butn {margin-left:20px;}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
.layui-layer-title {
text-align: center;
height: 80px;
line-height: 80px;
font-weight: 600;
font-size: 18px;
}
</style>
<!-- 标题栏 -->
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">工单管理列表</h3>
</div>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
<input id="serverid" name="server_id" type="text" value="{:I('server_id')}" style="display:none">
</div>
<div class="input-list input-list-game search_label_rehab">
<input type="text" name="nickname" value="{$_GET['nickname']}" placeholder="账号">
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search"
url="{:U('workOrder/statistics','model='.$model['name'],false)}">
搜索
</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>账号</th>
<th>
<a class="paixu" data-order='total_create_count'>
<if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'total_create_count'">发布工单数▲
<elseif condition="$userarpu_order eq 3 and $userarpu_order_type eq 'total_create_count'"/>发布工单数▼
<else />发布工单数<img src="__IMG__/up-down.png" width="13px">
</if>
</a>
</th>
<th>
<a class="paixu" data-order='total_accepted_count'>
<if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'total_accepted_count'">被接工单数
<elseif condition="$userarpu_order eq 3 and $userarpu_order_type eq 'total_accepted_count'"/>被接工单数
<else />被接工单数<img src="__IMG__/up-down.png" width="13px">
</if>
</a>
</th>
<th>
<a class="paixu" data-order='total_handle_count'>
<if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'total_handle_count'">接取工单数
<elseif condition="$userarpu_order eq 3 and $userarpu_order_type eq 'total_handle_count'"/>接取工单数
<else />接取工单数<img src="__IMG__/up-down.png" width="13px">
</if>
</a>
</th>
<th>
<a class="paixu" data-order='total_complete_count'>
<if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'total_complete_count'">完成工单数
<elseif condition="$userarpu_order eq 3 and $userarpu_order_type eq 'total_complete_count'"/>完成工单数
<else />完成工单数<img src="__IMG__/up-down.png" width="13px">
</if>
</a>
</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name="list_data">
<td colspan="99" class="text-center">aOh! 暂时还没有内容!</td>
<else/>
<volist name="list_data" id="data">
<tr>
<td>{$data.nickname}</td>
<td>{$data.total_create_count}</td>
<td>{$data.total_accepted_count}</td>
<td><?php echo $data['total_handle_count'] ?? 0;?></td>
<td><?php echo $data['total_complete_count'] ?? 0;?></td>
</tr>
</volist>
</empty>
</tbody>
</table>
</div>
</div>
<div class="page">
<if condition="$is_admin eq true ">
<a class="sch-btn" href="{:U('Export/exportWorkOrderStatistics',I('get.'))}">导出</a>
</if>
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="settlement/sheetList">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<script src="__STATIC__/layer/layer.js"></script>
<script src="__STATIC__/layer/extend/layer.ext.js"></script>
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js" ></script>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<style>
.layui-layer-demo .layui-layer-title {background:#F0F5F7;font-weight:bold;}
.layui-layer-demo .layui-layer-content {}
.layui-layer-demo .layui-layer-content table{width:100%;border:0;border-spacing:0;padding:0;}
.layui-layer-demo .layui-layer-content td {height:42px;padding-left:20px;}
.layui-layer-demo .layui-layer-content tr:hover {background:#F0F5F7;}
.layui-layer-demo .layui-layer-content tr~tr {border-top:1px solid #ccc;}
.layui-layer-demo .layui-layer-content td~td {border-left:1px solid #ccc;}
.layui-layer-demo .layui-layer-content tr:last-child td {}
</style>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('WorkOrder/statistics')}');
$(function () {
$(".select_gallery").select2();
//搜索功能
$("#search").click(function () {
var sdate = Date.parse($('#time-start').val()) / 1000;
var edate = Date.parse($('#time-end').val()) / 1000;
if (sdate > edate) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
if ((edate - sdate) > 2592000) {
layer.msg('时间间隔不能超过31天请重新选择日期');
return false;
}
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
query = query.replace(/^&/g, '');
if (url.indexOf('?') > 0) {
url += '&' + query;
} else {
url += '?' + query;
}
window.location.href = url;
});
//回车自动提交
$('.jssearch').find('input').keyup(function (event) {
if (event.keyCode === 13) {
$("#search").click();
}
});
$('#time-start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left'
})
$("#server_id").change(function () {
var g_server_id = $("#server_id option:selected").attr('server-id');
$("#serverid").val(g_server_id);
});
var server_id = "{:I('server_id')}";
$("#game_id").change(function(){
var addData = '';
$.ajax({
url:"{:U('Ajax/getServer')}",
type:"post",
data:{game_id:$("#game_id option:selected").attr('game-id')},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
for (var i in data){
if (data[i].id == server_id) {
str += "<option value='"+data[i].server_name+"' server-id='"+data[i].id+"' selected >"+data[i].server_name+"</option>"
} else {
str += "<option value='"+data[i].server_name+"' server-id='"+data[i].id+"'>"+data[i].server_name+"</option>"
}
}
var g_game_id = $("#game_id option:selected").attr('game-id');
$("#gameid").val(g_game_id);
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
}
})
});
$("#game_id").change();
})
$(".paixu").click(function(){
var that=$(this);
$data_order=that.attr('data-order');
$order_type='{$userarpu_order}';
if($order_type==''||$order_type=='4'){
$(".sortBy").attr('name','data_order');
val='3,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}else if($order_type=='3'){
$(".sortBy").attr('name','data_order');
val='4,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}
});
//点击排序
$('.list_sort').click(function(){
var url = $(this).attr('url');
var ids = $('.ids:checked');
var param = '';
if(ids.length > 0){
var str = new Array();
ids.each(function(){
str.push($(this).val());
});
param = str.join(',');
}
if(url != undefined && url != ''){
window.location.href = url.replace(".html","") + '/ids/' + param;
}
});
</script>
</block>

@ -204,16 +204,6 @@
<label>{:get_admin_name(is_login())}</label>
</td>
</tr>
<tr>
<td class="l noticeinfo">处理人</td>
<td class="r table_radio">
<span class="form_select"><select name="handler_id" id="handler_id">
<?php foreach ($admin_users as $user):?>
<option value="{$user['uid']}" >{$user.nickname}</option>
<?php endforeach;?>
</select></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">备注</td>
<td class="r table_radio">

Loading…
Cancel
Save