...
|
...
|
@@ -70,6 +70,23 @@ class ReformController extends RestBaseController |
|
|
$data['images'] = $common->relationUrl($data['images']);
|
|
|
$res = $reformModel->create($data);
|
|
|
if($res){
|
|
|
//极光推送
|
|
|
if($data['party'] == 0){
|
|
|
//甲方发起,推送乙方员工
|
|
|
$user_ids = $common->getUsersId($data['project_id'],'b_sid');
|
|
|
$content = config('site.reform_content_add_a');
|
|
|
}else{
|
|
|
//乙方发起,推送甲方员工
|
|
|
$user_ids = $common->getUsersId($data['project_id'],'a_sid');
|
|
|
$content = config('site.reform_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);
|
|
|
}
|
|
|
|
|
|
$id = $res->id;
|
|
|
$data1['create_time'] = time();
|
|
|
if($party['party'] == 0){
|
...
|
...
|
@@ -209,6 +226,18 @@ class ReformController extends RestBaseController |
|
|
$reformModel = new ReformModel();
|
|
|
$res = $reformModel->where(['id'=>$id,'status'=>0])->update(['status'=>1,'h_uid'=>$this->userId]);
|
|
|
if($res){
|
|
|
//极光推送,推送乙方员工
|
|
|
$project = $common->getProjectId('reform',['id'=>$id],'id,project_id');
|
|
|
$user_ids = $common->getUsersId($project['project_id'],'b_sid');
|
|
|
$content = config('site.reform_content_confirm_a');
|
|
|
|
|
|
$registration_id = $common->getPushUsers($user_ids);
|
|
|
if($registration_id){
|
|
|
$common = new CommonController();
|
|
|
$title = config('site.title');
|
|
|
$common->pushMessage($registration_id,$content,$title);
|
|
|
}
|
|
|
|
|
|
|
|
|
//甲方确认
|
|
|
$step_name = config('site.b_reform_step')[1];
|
...
|
...
|
@@ -257,6 +286,19 @@ class ReformController extends RestBaseController |
|
|
$reformModel = new ReformModel();
|
|
|
$res = $reformModel->where(['id'=>$id,'status'=>0])->update(['status'=>1,'h_uid'=>$this->userId]);
|
|
|
if($res){
|
|
|
//极光推送,推送甲方员工
|
|
|
$project = $common->getProjectId('reform',['id'=>$id],'id,project_id');
|
|
|
$user_ids = $common->getUsersId($project['project_id'],'a_sid');
|
|
|
$content = config('site.reform_content_confirm_b');
|
|
|
|
|
|
$registration_id = $common->getPushUsers($user_ids);
|
|
|
if($registration_id){
|
|
|
$common = new CommonController();
|
|
|
$title = config('site.title');
|
|
|
$common->pushMessage($registration_id,$content,$title);
|
|
|
}
|
|
|
|
|
|
|
|
|
//乙方确认
|
|
|
$step_name = config('site.a_reform_step')[1];
|
|
|
$common->repairStep($id,$step_name,1);
|
...
|
...
|
@@ -541,6 +583,19 @@ class ReformController extends RestBaseController |
|
|
];
|
|
|
$res = $reformModel->where(['id'=>$data['id'],'status'=>1])->update($arr);
|
|
|
if($res){
|
|
|
//极光推送,推送甲乙方领导
|
|
|
$project = $common->getProjectId('reform',['id'=>$data['id']],'id,project_id');
|
|
|
$user_ids = $common->getLeadersId($project['project_id']);
|
|
|
$content = config('site.reform_content_finish');
|
|
|
|
|
|
$registration_id = $common->getPushUsers($user_ids);
|
|
|
if($registration_id){
|
|
|
$common = new CommonController();
|
|
|
$title = config('site.title');
|
|
|
$common->pushMessage($registration_id,$content,$title);
|
|
|
}
|
|
|
|
|
|
|
|
|
//创建最后维修流程
|
|
|
$step_name = config('site.a_reform_step')[5];
|
|
|
$common->repairStep($data['id'],$step_name,1);
|
...
|
...
|
|