init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
namespace Super\Controller;
|
||||
//[1.1.96]
|
||||
use Think\Controller;
|
||||
|
||||
class WorkMessageController extends BaseController
|
||||
{
|
||||
public function index(){
|
||||
$work = M('work_question')->getField('number',true);
|
||||
$newWork = implode(',',$work);
|
||||
$url = "http://console.mobzhifu.com/index.php/VersionApi/WorkMessage/index";
|
||||
|
||||
$data['number'] = $newWork;
|
||||
$data['appid'] = 4;
|
||||
$re = http_request($url, $data);
|
||||
$ree = json_decode($re, true);
|
||||
if ($ree['type'] == 0) {
|
||||
$nored = $ree['num'];
|
||||
}
|
||||
$this->assign("nored",$nored);
|
||||
$arr = array(
|
||||
'allRead' => '/index.php/Super/WorkMessage/allRead', //标记全部已读
|
||||
'noticeDelete' => '/index.php/Super/WorkMessage/noticeDelete', //工单删除
|
||||
'flagRead' => '/index.php/Super/WorkMessage/flagRead', //标记部分已读
|
||||
);
|
||||
$authArr = checkFunction($arr);
|
||||
$this->assign('authArr', $authArr);
|
||||
$this -> display();
|
||||
|
||||
}
|
||||
// 消息通知
|
||||
public function getadmin(){
|
||||
|
||||
$work = M('work_question')->getField('number',true);
|
||||
$newWork = implode(',',$work);
|
||||
$url = "http://console.mobzhifu.com/index.php/VersionApi/WorkMessage/getAdmin";
|
||||
$data['number'] = $newWork;
|
||||
$data['appid'] = 4;
|
||||
$data['page'] = I('post.page');
|
||||
$data['limit'] = I('post.limit');
|
||||
$re = http_request($url, $data);
|
||||
$ree = json_decode($re, true);
|
||||
|
||||
if ($ree['type'] == 0) {
|
||||
$dataone = $ree['msg'];
|
||||
$count = $ree['num'];
|
||||
}
|
||||
if($dataone){
|
||||
foreach ($dataone as $kk=>&$vv){
|
||||
$vv['addtime'] = date('Y-m-d H:i:s',$vv['addtime']);
|
||||
if ($vv['state'] == 1) {
|
||||
$vv['state'] = '未读';
|
||||
}else if ($vv['state'] == 2){
|
||||
$vv['state'] = '已读';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$res['code'] = 0;
|
||||
$res['msg'] = '';
|
||||
$res['data'] = $dataone;
|
||||
$res['count'] = $count;
|
||||
$this->ajaxReturn($res);
|
||||
}
|
||||
|
||||
// 标记成已读
|
||||
public function flagRead(){
|
||||
if (IS_POST){
|
||||
$data['ids'] = I("post.ids");
|
||||
$data['appid'] = 4;
|
||||
$url = "http://console.mobzhifu.com/index.php/VersionApi/WorkMessage/custRead";
|
||||
$re = http_request($url, $data);
|
||||
$ree = json_decode($re, true);
|
||||
if ($ree['type'] == 0) {
|
||||
$res['status'] = 0;
|
||||
$res['msg'] = '操作成功';
|
||||
$res['num'] = $ree['num'];
|
||||
}else{
|
||||
$res['status'] = 1;
|
||||
$res['msg'] = '操作失败';
|
||||
}
|
||||
$this->ajaxReturn($res);
|
||||
}
|
||||
}
|
||||
|
||||
public function allRead(){
|
||||
$work = M('work_question')->getField('number',true);
|
||||
$newWork = implode(',',$work);
|
||||
$url = "http://console.mobzhifu.com/index.php/VersionApi/WorkMessage/allRead";
|
||||
$data['number'] = $newWork;
|
||||
$data['appid'] = 4;
|
||||
$re = http_request($url, $data);
|
||||
$ree = json_decode($re, true);
|
||||
if ($ree['type'] == 0) {
|
||||
$res['status'] = 0;
|
||||
$res['msg'] = '操作成功';
|
||||
}else{
|
||||
$res['status'] = 1;
|
||||
$res['msg'] = '操作成功';
|
||||
}
|
||||
$this->ajaxReturn($res);
|
||||
}
|
||||
|
||||
// 删除消息(包含批量删除)
|
||||
public function noticeDelete(){
|
||||
|
||||
if (IS_POST){
|
||||
$data['ids'] = I("post.ids");
|
||||
$data['appid'] = 4;
|
||||
$url = "http://console.mobzhifu.com/index.php/VersionApi/WorkMessage/custDel";
|
||||
$re = http_request($url, $data);
|
||||
$ree = json_decode($re, true);
|
||||
|
||||
if ($ree['type'] == 0) {
|
||||
$res['status'] = 0;
|
||||
$res['msg'] = '删除成功';
|
||||
$res['num'] = $ree['num'];
|
||||
|
||||
}else{
|
||||
$res['status'] = 1;
|
||||
$res['msg'] = '删除失败';
|
||||
}
|
||||
$this->ajaxReturn($res);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户