...
|
...
|
@@ -88,6 +88,17 @@ class CheckController extends RestBaseController |
|
|
$checkModel = new CheckModel();
|
|
|
$res = $checkModel->create($data);
|
|
|
if($res){
|
|
|
//极光推送
|
|
|
//乙方发起,提醒甲方领导
|
|
|
$user_ids = $common->getLeaderA($data['project_id'],'a_cid');
|
|
|
$content = config('site.check_content_add_b');
|
|
|
$registration_id = $common->getPushUsers($user_ids);
|
|
|
if($registration_id){
|
|
|
$common = new CommonController();
|
|
|
$title = config('site.title');
|
|
|
$common->pushMessage($registration_id,$content,$title);
|
|
|
}
|
|
|
|
|
|
$this->success('月检信息提交成功');
|
|
|
}else{
|
|
|
$this->error('失败');
|
...
|
...
|
@@ -161,6 +172,20 @@ class CheckController extends RestBaseController |
|
|
$common = new CommonController();
|
|
|
$field = 'id,ins_m_time,address,a_uid,remark';
|
|
|
$res = $common->getCheckById(['id'=>$id,'status'=>1],$field);
|
|
|
|
|
|
//极光推送
|
|
|
//乙方重新发起,提醒甲方领导
|
|
|
$project = $common->getProjectId('check',['id'=>$id],'id,project_id');
|
|
|
$user_ids = $common->getUserA($project['project_id'],'a_cid');
|
|
|
$content = config('site.check_content_again_b');
|
|
|
|
|
|
$registration_id = $common->getPushUsers($user_ids);
|
|
|
if($registration_id){
|
|
|
$common = new CommonController();
|
|
|
$title = config('site.title');
|
|
|
$common->pushMessage($registration_id,$content,$title);
|
|
|
}
|
|
|
|
|
|
$this->success('成功',$res);
|
|
|
}else{
|
|
|
$this->error('请求方式错误!');
|
...
|
...
|
@@ -347,6 +372,18 @@ class CheckController extends RestBaseController |
|
|
];
|
|
|
$res = $checkModel->where(['id'=>$data['id'],'status'=>2])->update($data1);
|
|
|
if($res){
|
|
|
//极光推送,推送甲乙方领导
|
|
|
$project = $common->getProjectId('check',['id'=>$data['id']],'id,project_id');
|
|
|
$user_ids = $common->getLeadersId($project['project_id']);
|
|
|
$content = config('site.check_content_finish');
|
|
|
|
|
|
$registration_id = $common->getPushUsers($user_ids);
|
|
|
if($registration_id){
|
|
|
$common = new CommonController();
|
|
|
$title = config('site.title');
|
|
|
$common->pushMessage($registration_id,$content,$title);
|
|
|
}
|
|
|
|
|
|
$this->success('成功');
|
|
|
}else{
|
|
|
$this->error('失败');
|
...
|
...
|
|