|
@@ -12,6 +12,8 @@ class flow_meetingClassModel extends flowModel
|
|
$this->hyarrb = array('green','blue','#ff6600','#888888');
|
|
$this->hyarrb = array('green','blue','#ff6600','#888888');
|
|
$this->dbobj = c('date');
|
|
$this->dbobj = c('date');
|
|
|
|
|
|
|
|
+ $this->defaultorder = 'start_time desc';
|
|
|
|
+
|
|
$this->meeting_room = m("meeting_room")->meetingRoomIdList();
|
|
$this->meeting_room = m("meeting_room")->meetingRoomIdList();
|
|
|
|
|
|
$this->reatearr = array(
|
|
$this->reatearr = array(
|
|
@@ -157,7 +159,7 @@ class flow_meetingClassModel extends flowModel
|
|
|
|
|
|
} else if ($ors['num'] == 'enableMeeting') {
|
|
} else if ($ors['num'] == 'enableMeeting') {
|
|
|
|
|
|
- $time = time();
|
|
|
|
|
|
+ $time = time();
|
|
|
|
|
|
$stime = strtotime($this->rs['start_time']);
|
|
$stime = strtotime($this->rs['start_time']);
|
|
$etime = strtotime($this->rs['end_time']);
|
|
$etime = strtotime($this->rs['end_time']);
|
|
@@ -198,7 +200,7 @@ class flow_meetingClassModel extends flowModel
|
|
], "id={$this->id}");
|
|
], "id={$this->id}");
|
|
|
|
|
|
// 更换会议室 - 发送会议短信
|
|
// 更换会议室 - 发送会议短信
|
|
- $this->meetingSms($this->id);
|
|
|
|
|
|
+ $this->meetingSuccSms($this->id);
|
|
} else {
|
|
} else {
|
|
return $isApply;
|
|
return $isApply;
|
|
}
|
|
}
|
|
@@ -229,28 +231,29 @@ class flow_meetingClassModel extends flowModel
|
|
|
|
|
|
|
|
|
|
//审核之前调用$zt 状态, $sm说明
|
|
//审核之前调用$zt 状态, $sm说明
|
|
- protected function flowcheckbefore($zt, $sm){
|
|
|
|
- $haha = $this->rs['room_id'];
|
|
|
|
- $meet_room = $sm['room_id'];
|
|
|
|
- $meet_room = $sm['meeting_room'];
|
|
|
|
- $meeting = m('meeting')->getone("room_id={$meet_room} and ");
|
|
|
|
- $isApply = m('meeting')->isapplymsg($this->rs['start_time'], $this->rs['end_time'], $meet_room, $this->id, 1);
|
|
|
|
- if ($this->nowcourse['step'] == 2 && !empty($isApply)) {
|
|
|
|
- return [
|
|
|
|
- "msg"=>$isApply
|
|
|
|
- ];
|
|
|
|
|
|
+ protected function flowcheckbefore($zt, $sm) {
|
|
|
|
+ if ($this->nowcourse['step'] == 1) {
|
|
|
|
+ $this->meetingAuditSms($this->id);
|
|
|
|
+// return [
|
|
|
|
+// "msg"=>'发送短信'
|
|
|
|
+// ];
|
|
|
|
+ } else if ($this->nowcourse['step'] == 2) {
|
|
|
|
+ if (!empty($isApply)) {
|
|
|
|
+ $haha = $this->rs['room_id'];
|
|
|
|
+ $meet_room = $sm['room_id'];
|
|
|
|
+ $meet_room = $sm['meeting_room'];
|
|
|
|
+ $meeting = m('meeting')->getone("room_id={$meet_room} and ");
|
|
|
|
+ $isApply = m('meeting')->isapplymsg($this->rs['start_time'], $this->rs['end_time'], $meet_room, $this->id, 1);
|
|
|
|
+ return [
|
|
|
|
+ "msg"=>$isApply
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- return null;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//审核完成后调用
|
|
//审核完成后调用
|
|
protected function flowcheckafter($zt, $sm){
|
|
protected function flowcheckafter($zt, $sm){
|
|
- // 发送会议短信
|
|
|
|
-// $this->meetingSms($this->id);
|
|
|
|
- $haha = $this->rs['room_id'];
|
|
|
|
- return false;
|
|
|
|
-
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -258,7 +261,7 @@ class flow_meetingClassModel extends flowModel
|
|
protected function flowcheckfinsh($sm){
|
|
protected function flowcheckfinsh($sm){
|
|
|
|
|
|
// 审批完成给负责人发短信
|
|
// 审批完成给负责人发短信
|
|
- $this->meetingSms($this->id);
|
|
|
|
|
|
+ $this->meetingSuccSms($this->id);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -287,7 +290,7 @@ class flow_meetingClassModel extends flowModel
|
|
}
|
|
}
|
|
|
|
|
|
// 短信发送
|
|
// 短信发送
|
|
- public function meetingSms($meetId) {
|
|
|
|
|
|
+ public function meetingSuccSms($meetId) {
|
|
|
|
|
|
if (empty($meetId)) {
|
|
if (empty($meetId)) {
|
|
m("log")->addlog("短信发送", "会议Id为空");
|
|
m("log")->addlog("短信发送", "会议Id为空");
|
|
@@ -381,9 +384,45 @@ class flow_meetingClassModel extends flowModel
|
|
m("log")->addlog("会议短信", $nullMobileInfo);
|
|
m("log")->addlog("会议短信", $nullMobileInfo);
|
|
};
|
|
};
|
|
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ public function meetingAuditSms($meetId) {
|
|
|
|
+
|
|
|
|
+ if (empty($meetId)) {
|
|
|
|
+ m("log")->addlog("短信发送", "会议Id为空");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 获取当前会议信息
|
|
|
|
+ $meeting = m("meeting")->getone("id={$this->id}");
|
|
|
|
+
|
|
|
|
+ $meetTime = $meeting['start_time']; // 时间
|
|
|
|
+ $meetName = $meeting['title']; // 主题
|
|
|
|
+ $smsInfo = [];
|
|
|
|
+ m("log")->addlog("会议室审批", "发送短信提醒会议室管理员");
|
|
|
|
+ $meetingManager = m("flow_cname")->getone("num='meeting_manager'");
|
|
|
|
+ if (!empty($meetingManager)) {
|
|
|
|
+ $cAdmins = m("admin")->getall("id in ({$meetingManager['checkid']})");
|
|
|
|
+ if (!empty($cAdmins) && is_array($cAdmins)) {
|
|
|
|
+ for ($i = 0; $i < count($cAdmins); $i++) {
|
|
|
|
+ $user = $cAdmins[$i];
|
|
|
|
+ $mobile = $user['mobile'];
|
|
|
|
+ $meetUName = $user['name'];
|
|
|
|
+ if (!empty($mobile)) {
|
|
|
|
+ $smsInfo['phoneNum'][] = $mobile;
|
|
|
|
+ $smsInfo['para'][] = [
|
|
|
|
+ "usernam" => $meetUName,
|
|
|
|
+ "meetingname" => $meetTime,
|
|
|
|
+ "begindate" => $meetName
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (count($smsInfo['phoneNum']) > 0) {
|
|
|
|
+ m('send_sms')->sendBatchSms($smsInfo['phoneNum'], $smsInfo['para'], 2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|