Selaa lähdekoodia

会议功能修改

q 1 vuosi sitten
vanhempi
commit
ed6d948a38

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 53 - 1
webmain/flow/page/input_meeting_key.html


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 22 - 1
webmain/flow/page/input_repair_fault.html


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
webmain/flow/page/view_meeting_key_0.html


+ 18 - 12
webmain/model/flow/meeting_keyModel.php

@@ -14,14 +14,23 @@ class flow_meeting_keyClassModel extends flowModel
 
     //提交时调用
     protected function flowsubmit($na, $sm) {
-        if ($na == '编辑') {
+        if ($na != '编辑') {
+            // 提交时初始化为0
+            m('meeting_topics')->update(["topic_state"=>0], 'mid='.$this->id);
+            m('meeting_key')->update(["meet_state"=>1], 'id='.$this->id);
+        }
+        $meet = m('meeting')->getone("id={$this->id}",'start_time');
 
-        } else {
-            m('meeting_topics')->update(["topic_state"=>0], '1=1');
+        if (isset($meet['start_time']) && strtotime($meet['start_time']) > time()) {
             $topic = m('meeting_topics')->getone("mid={$this->id}",'id, topic_state', 'sort');
-            if (isset($topic['id']) && $topic['topic_state']<2) {
+            if (isset($topic['id']) && $topic['topic_state'] < 2) {
                 m('meeting')->firstMeetingTopicStart($this->id);
             }
+        } else {
+            $topic = m('meeting_topics')->getone("mid={$this->id}",'id, topic_state', 'sort');
+            if (isset($topic['id']) && $topic['topic_state'] < 2) {
+                m('meeting')->update(["meet_state"=>1], "id=".$topic['id']);
+            }
         }
     }
 
@@ -46,17 +55,15 @@ class flow_meeting_keyClassModel extends flowModel
                 $nzt = 2;
             } else if ($stime > $time){
                 $nzt = 0;
-            } else {
-                $nzt = 1;
-                $topic = m('meeting_topics')->getone("mid={$this->id}",'id, topic_state', 'sort');
-                if (isset($topic['id']) && $topic['topic_state']<2) {
-                    m('meeting')->firstMeetingTopicStart($this->id);
-                }
             }
         }
-
+        // 会议开始时的处理
         if ($stime <= $time && $nzt != 2) {
             $nzt = 1;
+            $topic = m('meeting_topics')->getone("mid={$this->id}",'id, topic_state', 'sort');
+            if (isset($topic['id']) && $topic['topic_state'] < 2) {
+                m('meeting')->firstMeetingTopicStart($this->id);
+            }
         }
 
         // 更新数据状态
@@ -144,7 +151,6 @@ class flow_meeting_keyClassModel extends flowModel
     // 子表数据替换处理$lx=0编辑时,1展示时
     protected function flowsubdata($rows, $lx=0){
         if ($lx == 1) {
-            m('log')->addlog('编辑', $lx);
             for ($i = 0; $i < count($rows); $i++) {
                 $index = $rows[$i]['topic_state'] ?? 0;
                 $rows[$i]['topic_state'] = m('meeting')->ytarra[$index];

+ 1 - 1
webmain/model/meeting_roomModel.php

@@ -10,7 +10,7 @@ class meeting_roomClassModel extends Model
         for ($i = 0; $i < count($dataArr); $i++) {
             $data = $dataArr[$i];
             $arr[$i]["name"] = $data['room_name'];
-            $arr[$i]["value"] = $data['room_name'];
+            $arr[$i]["value"] = $data['id'];
             $arr[$i]["subname"] = $data['desc'];
             $arr[$i]["value_id"] = $data['id'];
         }

+ 5 - 1
webmain/public/test/testAction.php

@@ -1,7 +1,7 @@
 <?php 
 class testClassAction extends ActionNot{
 	
-	//测试地址http://127.0.0.1/app/xinhu/?m=test&d=public
+	// 测试地址 http://127.0.0.1/app/xinhu/?m=test&d=public
 	public function defaultAction()
 	{
 		$this->display = false;
@@ -12,5 +12,9 @@ class testClassAction extends ActionNot{
 		//echo  m('weixinqy:index')->getagentid('adds,办公助手e,OA2主页,办公助手');
 		//return m('weixin:media')->downmedia('3MhSL1jKzVjnDOI3GHBU-Zf5xXJuVs48ciMMWiP0xv4Afp9ijTTalyhYTpNG2o8mEr-O5tGcNGeRBp-6_N5Y_CQ');
 	}
+
+    public function testAction() {
+        return "haha";
+    }
 	
 }

+ 25 - 11
webmain/task/openapi/openmeetAction.php

@@ -27,14 +27,14 @@ class openmeetClassAction extends openapiAction
         }
 
         $sqlStr = /** @lang text */
-            "SELECT 1 as type, id, title, start_time, end_time, null as compere, meet_state  
+            "SELECT 1 as type, id, title, start_time, end_time, null as compere, meet_state, is_hand
                FROM `[Q]meeting` 
               where start_time REGEXP '".date("Y-m-d")."'
                 and end_time > now()
                 and status = 1
                 and meeting_room = '".$rawData['room_name']."'
              union all
-             SELECT 2 as type, id, title, start_time, end_time, compere, meet_state 
+             SELECT 2 as type, id, title, start_time, end_time, compere, meet_state, is_hand 
                FROM `[Q]meeting_key` 
               where start_time REGEXP '".date("Y-m-d")."' 
                 and end_time > now()
@@ -83,7 +83,7 @@ class openmeetClassAction extends openapiAction
                 } else {
                     m("meeting_key")->update(["meet_state"=>0], "id=".$meeting['id']);
                 }
-            } else if (strtotime($meeting['start_time']) < strtotime(date("Y-m-d H:i:s"))) {
+            } else if (strtotime($meeting['start_time']) < strtotime(date("Y-m-d H:i:s")) && $meeting['is_hand'] != 2) {
                 if ($meeting['type'] == 1) {
                     m("meeting")->update(["meet_state"=>1], "id=".$meeting['id']);
                 } else {
@@ -93,7 +93,8 @@ class openmeetClassAction extends openapiAction
         }
 
         $nowMeetingSql = /** @lang text */
-            "SELECT 1 as type, id, title, start_time, end_time, null as compere, meet_state, meeting_room, attendees
+            "select * from (
+            SELECT 1 as type, id, title, start_time, end_time, null as compere, meet_state, meeting_room, attendees
                FROM `[Q]meeting` 
               where status = 1 
                 and start_time < now() 
@@ -102,11 +103,12 @@ class openmeetClassAction extends openapiAction
              union all
              SELECT 2 as type, id, title, start_time, end_time, compere, meet_state, meeting_room, null as attendees
                FROM `[Q]meeting_key` 
-              where start_time < now() and end_time > now() and meeting_room = '".$rawData['room_name']."'";
+              where start_time < now() and end_time > now() and meeting_room = '".$rawData['room_name']."'
+              ) as t order by start_time";
         $nowMeetingData = $this->db->getall($nowMeetingSql);
 
 
-        if (count($nowMeetingData) > 0) {
+        if (count($nowMeetingData) > 0 && $nowMeetingData[0]['meet_state'] != 2) {
             $nowMeet = $nowMeetingData[0];
 
             $data['basic_information'] = [
@@ -122,18 +124,28 @@ class openmeetClassAction extends openapiAction
             if ($nowMeet['type'] == 2) {
 
                 $topics = $this->db->getall("select `id`, `topic_title`, `topic_attendee`, `topic_state`, `topic_info` from `[Q]meeting_topics` where mid = {$nowMeet['id']} order by sort");
-
+                $j = count($topics);
+                $meetingTopic = array_fill(0, count($topics), null);
                 // 会议议题处理
                 for ($i = 0; $i < count($topics); $i++) {
                     $info = $topics[$i];
-                    $data['meetingTopic'][$i]['state'] = $info['topic_state'];
-                    $data['meetingTopic'][$i]['tip'] = m("meeting")->ytarra[$info['topic_state']];
-                    $data['meetingTopic'][$i]['text'] = $info['topic_title'];
+                    // 用于排序(已结束放最后)
+                    if ($info['topic_state'] == 3) {
+                        $index = $j - $i - 1;
+                    } else {
+                        $index = $i - 2;
+                    }
+                    $meetingTopic[$index]['state'] = $info['topic_state'];
+                    $meetingTopic[$index]['tip'] = m("meeting")->ytarra[$info['topic_state']];
+                    $meetingTopic[$index]['text'] = $info['topic_title'];
+
                     if ($info['topic_state'] == 2) {
+                        // 当前议题 + 参会人员
                         $data['participants'][] = [
                             "topics" => $info['topic_title'],
                             "personnel_list" => str_replace("\n", "<br />", $info['topic_info']),
                         ];
+                        // 下一议题 + 参会人员
                         if (isset($topics[$i + 1])) {
                             $data['participants'][] = [
                                 "topics" => $topics[$i + 1]['topic_title'],
@@ -142,14 +154,16 @@ class openmeetClassAction extends openapiAction
                         }
                     }
                 }
+                $data['meetingTopic'] = $meetingTopic;
 
             } else {
                 // 普通会议,议题为空
                 $data['meetingTopic'] = [];
+                // 基础会议人员信息
                 $data['participants'] = [
                     [
                         "topics"=>$nowMeet['title'],
-                        "personnel_list"=>$nowMeet['attendees'],
+                        "personnel_list"=>str_replace("\n", "<br />", $nowMeet['attendees']),
                     ]
                 ];
             }

+ 28 - 0
webmain/task/openapi/openupfileAction.php

@@ -0,0 +1,28 @@
+<?php
+
+/**
+ *    会议相关
+ *    请求地址如:http://oa.test/api.php?m=openmeet&a=test&openkey=fee5efd3a93ca5c6a85b679cde60faa2
+ */
+class openupfileClassAction extends openapiAction
+{
+
+    public function testAction() {
+        $str = $this->postdata;
+        return json_encode($str);
+    }
+
+    public function upfileAction()
+    {
+        if(!$_FILES)exit('sorry!');
+        $upimg	= c('upfile');
+        $maxsize= (int)$this->get('maxsize', 5);
+        $uptype	= $this->get('uptype', '*');
+        $thumbnail	= $this->get('thumbnail');
+        $upimg->initupfile($uptype, ''.UPDIR.'|'.date('Y-m').'', $maxsize);
+        $upses	= $upimg->up('file');
+        $arr 	= c('down')->uploadback($upses, $thumbnail, false);
+        $this->returnjson($arr);
+    }
+
+}