Преглед изворни кода

会议议题显示、审核短信

q пре 1 година
родитељ
комит
e164b62b3e

+ 60 - 21
webmain/model/flow/meetingModel.php

@@ -12,6 +12,8 @@ class flow_meetingClassModel extends flowModel
         $this->hyarrb 	= array('green','blue','#ff6600','#888888');
         $this->dbobj	= c('date');
 
+        $this->defaultorder = 'start_time desc';
+
         $this->meeting_room = m("meeting_room")->meetingRoomIdList();
 
         $this->reatearr = array(
@@ -157,7 +159,7 @@ class flow_meetingClassModel extends flowModel
 
         } else if ($ors['num'] == 'enableMeeting') {
 
-            $time 		 = time();
+            $time 	= time();
 
             $stime 	= strtotime($this->rs['start_time']);
             $etime 	= strtotime($this->rs['end_time']);
@@ -198,7 +200,7 @@ class flow_meetingClassModel extends flowModel
                 ], "id={$this->id}");
 
                 // 更换会议室 - 发送会议短信
-                $this->meetingSms($this->id);
+                $this->meetingSuccSms($this->id);
             } else {
                 return $isApply;
             }
@@ -229,28 +231,29 @@ class flow_meetingClassModel extends flowModel
 
 
     //审核之前调用$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){
-        // 发送会议短信
-//        $this->meetingSms($this->id);
-        $haha = $this->rs['room_id'];
-        return false;
-
 
     }
 
@@ -258,7 +261,7 @@ class flow_meetingClassModel extends flowModel
     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)) {
             m("log")->addlog("短信发送", "会议Id为空");
@@ -381,9 +384,45 @@ class flow_meetingClassModel extends flowModel
             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);
+                }
+            }
+        }
+    }
 
 }

+ 4 - 1
webmain/model/flow/meeting_keyModel.php

@@ -90,9 +90,12 @@ class flow_meeting_keyClassModel extends flowModel
                 }
             }
 
+        } else if ($stime > $time) {
+            $topic = m('meeting_topics')->getone("mid={$this->id}",'id, topic_state, topic_title', 'sort asc');
+            $rs['topic'] = $this->getTopicInfoState($topic);
         } else {
             $topic = m('meeting_topics')->getone("mid={$this->id}",'id, topic_state, topic_title', 'sort desc');
-            $rs['topic'] = $this->getTopicState($topic['topic_state']).$topic['topic_title'];
+            $rs['topic'] = $this->getTopicState($topic['topic_state']);
         }
 
         // 更新数据状态

+ 1 - 0
webmain/model/send_smsModel.php

@@ -32,6 +32,7 @@ class send_smsClassModel extends Model
     private $templateCode = [
         "",
         "SMS_465319645", // 会议提醒
+        "SMS_465745943", // 会议审批提醒
     ];
 
     private $sign = "智慧矿山";

+ 1 - 1
webmain/task/api/loginAction.php

@@ -11,7 +11,7 @@ class loginClassAction extends apiAction
 			if(isset($arr['mobile'])){
 				$this->showreturn($arr, $arr['msg'], 205);
 			}
-			
+
 			$arrs = array(
 				'uid' 	=> $arr['uid'],
 				'name' 	=> $arr['name'],