|
@@ -3,7 +3,7 @@
|
|
class flow_meetingClassModel extends flowModel
|
|
class flow_meetingClassModel extends flowModel
|
|
{
|
|
{
|
|
|
|
|
|
- public $hyarra, $ytarra, $hyarrb, $dbobj, $reatearr;
|
|
|
|
|
|
+ public $hyarra, $ytarra, $hyarrb, $dbobj, $reatearr, $meeting_room;
|
|
|
|
|
|
public function initModel()
|
|
public function initModel()
|
|
{
|
|
{
|
|
@@ -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->meeting_room = m("meeting_room")->meetingRoomIdList();
|
|
|
|
+
|
|
$this->reatearr = array(
|
|
$this->reatearr = array(
|
|
'd' => '每天',
|
|
'd' => '每天',
|
|
'w1' => '每周一',
|
|
'w1' => '每周一',
|
|
@@ -26,6 +28,11 @@ class flow_meetingClassModel extends flowModel
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //录入页上的标题
|
|
|
|
+ public function inputtitle() {
|
|
|
|
+ return "会议室审批单";
|
|
|
|
+ }
|
|
|
|
+
|
|
//子表数据替换处理$lx=0编辑时,1展示时
|
|
//子表数据替换处理$lx=0编辑时,1展示时
|
|
protected function flowsubdata($rows, $lx=0){
|
|
protected function flowsubdata($rows, $lx=0){
|
|
|
|
|
|
@@ -48,8 +55,10 @@ class flow_meetingClassModel extends flowModel
|
|
|
|
|
|
// m('log')->addlog('会议单据', json_encode($rs, true));
|
|
// m('log')->addlog('会议单据', json_encode($rs, true));
|
|
|
|
|
|
|
|
+ $this->id = $rs['id'];
|
|
$zt = $rs['meet_state'];
|
|
$zt = $rs['meet_state'];
|
|
- $is_hand = $rs['is_hand'];
|
|
|
|
|
|
+ $is_hand = $rs['is_hand'] ?? 0;
|
|
|
|
+ $room_id = $rs['room_id'];
|
|
$nzt = $zt;
|
|
$nzt = $zt;
|
|
$time = time();
|
|
$time = time();
|
|
|
|
|
|
@@ -57,7 +66,7 @@ class flow_meetingClassModel extends flowModel
|
|
$etime = strtotime($rs['end_time']);
|
|
$etime = strtotime($rs['end_time']);
|
|
|
|
|
|
|
|
|
|
- if($is_hand != 2){
|
|
|
|
|
|
+ if($is_hand != 1){
|
|
if($etime < $time){
|
|
if($etime < $time){
|
|
$nzt = 2;
|
|
$nzt = 2;
|
|
} else if ($stime > $time){
|
|
} else if ($stime > $time){
|
|
@@ -83,6 +92,7 @@ class flow_meetingClassModel extends flowModel
|
|
|
|
|
|
// 将id转换为文字
|
|
// 将id转换为文字
|
|
$rs['meet_state'] = $this->getstatezt($zt);
|
|
$rs['meet_state'] = $this->getstatezt($zt);
|
|
|
|
+ if (!empty($room_id)) $rs['room_id'] = $this->meeting_room[$room_id]['room_name'];
|
|
|
|
|
|
|
|
|
|
return $rs;
|
|
return $rs;
|
|
@@ -117,7 +127,7 @@ class flow_meetingClassModel extends flowModel
|
|
}
|
|
}
|
|
|
|
|
|
if (isset($topics[count($topics) - 1]) && $topics[count($topics) - 1]['topic_state'] == 2) {
|
|
if (isset($topics[count($topics) - 1]) && $topics[count($topics) - 1]['topic_state'] == 2) {
|
|
- m('meeting')->update(['is_hand'=>2,'meet_state'=>2], "id={$this->id}");
|
|
|
|
|
|
+ m('meeting')->update(['is_hand'=>1,'meet_state'=>2], "id={$this->id}");
|
|
}
|
|
}
|
|
|
|
|
|
} else if ($ors['num'] == 'enableMeeting') {
|
|
} else if ($ors['num'] == 'enableMeeting') {
|
|
@@ -130,12 +140,12 @@ class flow_meetingClassModel extends flowModel
|
|
if ($stime < $time){
|
|
if ($stime < $time){
|
|
$data = [
|
|
$data = [
|
|
'meet_state'=>1,
|
|
'meet_state'=>1,
|
|
- 'is_hand'=>2
|
|
|
|
|
|
+ 'is_hand'=>1
|
|
];
|
|
];
|
|
} else if ($stime >= $time) {
|
|
} else if ($stime >= $time) {
|
|
$data = [
|
|
$data = [
|
|
'meet_state'=>0,
|
|
'meet_state'=>0,
|
|
- 'is_hand'=>2
|
|
|
|
|
|
+ 'is_hand'=>1
|
|
];
|
|
];
|
|
}
|
|
}
|
|
m('meeting')->update($data, "id={$this->id}");
|
|
m('meeting')->update($data, "id={$this->id}");
|
|
@@ -148,10 +158,23 @@ class flow_meetingClassModel extends flowModel
|
|
|
|
|
|
// $data = [
|
|
// $data = [
|
|
// 'meet_state'=>2,
|
|
// 'meet_state'=>2,
|
|
-// 'is_hand'=>2
|
|
|
|
|
|
+// 'is_hand'=>1
|
|
// ];
|
|
// ];
|
|
//
|
|
//
|
|
// m('meeting_key')->update($data, "id={$this->id}");
|
|
// m('meeting_key')->update($data, "id={$this->id}");
|
|
|
|
+ } else if ($ors['num'] == "noup") {
|
|
|
|
+
|
|
|
|
+ // 动作名
|
|
|
|
+ if ($ors['actname'] == "change_room") {
|
|
|
|
+ $data = $this->rs;
|
|
|
|
+ $roomName = $this->meeting_room[$data['room_id']]['room_name'];
|
|
|
|
+ if (!empty($roomName)) {
|
|
|
|
+ $this->update([
|
|
|
|
+ "meeting_room"=>$roomName,
|
|
|
|
+ ], "id={$this->id}");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -185,30 +208,28 @@ class flow_meetingClassModel extends flowModel
|
|
}
|
|
}
|
|
|
|
|
|
if (!empty($depts)) {
|
|
if (!empty($depts)) {
|
|
- $deptSql = "select distinct b.mobile from [Q]dept a left join [Q]admin b on a.headid = b.id where a.id in (".implode(',', $depts).") and a.headid is not null";
|
|
|
|
|
|
+ $deptSql = "select distinct b.mobile, a.name from [Q]dept a left join [Q]admin b on a.headid = b.id where a.id in (".implode(',', $depts).") ";
|
|
m("log")->addlog("会议室审批", $deptSql);
|
|
m("log")->addlog("会议室审批", $deptSql);
|
|
$depts = $this->db->getall($deptSql);
|
|
$depts = $this->db->getall($deptSql);
|
|
|
|
+ $depts_e = [];
|
|
// 部门负责人手机号
|
|
// 部门负责人手机号
|
|
foreach ($depts as $val) {
|
|
foreach ($depts as $val) {
|
|
- $mobile[] = $val['mobile'];
|
|
|
|
|
|
+ if (empty($val['mobile'])) {
|
|
|
|
+ $depts_e[] = $val['name'];
|
|
|
|
+ } else {
|
|
|
|
+ $mobile[] = $val['mobile'];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- m("log")->addlog("会议室审批", "短信包括:".implode(' ', $mobile));
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //提交时调用
|
|
|
|
- protected function flowsubmit($na, $sm) {
|
|
|
|
-
|
|
|
|
- if ($this->id == null) {
|
|
|
|
- return ;
|
|
|
|
|
|
+ $infoText = "短信包括:".implode('、', $mobile);
|
|
|
|
+ if (!empty($depts_e)) {
|
|
|
|
+ $infoText .= ",其中".implode('、', $mobile)."未设负责人,无法通知";
|
|
}
|
|
}
|
|
|
|
+ m("log")->addlog("会议室审批", $infoText);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
public function getstatezt($zt)
|
|
public function getstatezt($zt)
|
|
{
|
|
{
|
|
if (isset($this->hyarrb[$zt])) {
|
|
if (isset($this->hyarrb[$zt])) {
|