Skip to content

Commit 222255b

Browse files
fix queueDashboard
1 parent e357770 commit 222255b

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

protected/controllers/MethodpayController.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Acoes do modulo "Methodpay".
45
*
@@ -70,9 +71,12 @@ public function actionRead2()
7071

7172
foreach ($values as $key => $value) {
7273

73-
array_push($amount, [
74-
'id' => $key + 1,
75-
'amount' => $value]
74+
array_push(
75+
$amount,
76+
[
77+
'id' => $key + 1,
78+
'amount' => $value
79+
]
7680
);
7781
}
7882

@@ -81,7 +85,6 @@ public function actionRead2()
8185
$this->nameCount => 10,
8286
$this->nameSum => [],
8387
]);
84-
8588
}
8689

8790
public function extraFilterCustom($filter)

protected/controllers/QueueDashBoardController.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Acoes do modulo "Queue".
45
*
@@ -121,22 +122,18 @@ public function getQueue()
121122
try {
122123
$command->execute();
123124
} catch (Exception $e) {
124-
125125
}
126-
127126
}
128127
}
129-
130128
}
131-
132129
}
133130

134131
public function setAttributesModels($attributes, $models)
135132
{
136133

137134
$pkCount = is_array($attributes) || is_object($attributes) ? $attributes : [];
138135
for ($i = 0; $i < count($pkCount); $i++) {
139-
$duration = time() - strtotime($attributes[$i]['time']) - $attributes[$i]['holdtime'];
136+
$duration = time() - (int)strtotime($attributes[$i]['time']) - (int)$attributes[$i]['holdtime'];
140137
$attributes[$i]['duration'] = $duration;
141138
}
142139
return $attributes;
@@ -154,5 +151,4 @@ public function get_string_between($string, $start, $end)
154151
$len = strpos($string, $end, $ini) - $ini;
155152
return trim(substr($string, $ini, $len));
156153
}
157-
158154
}

script/installOpenSips-3.1.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,12 @@ mysql -u root -p$(awk '{print $1}' /root/passwordMysql.log) opensips -e "ALTER T
170170
mysql -u root -p$(awk '{print $1}' /root/passwordMysql.log) opensips -e "ALTER TABLE subscriber ADD cpslimit INT( 11 ) NOT NULL DEFAULT '-1'"
171171
mysql -u root -p$(awk '{print $1}' /root/passwordMysql.log) opensips -e "ALTER TABLE address CHANGE context_info context_info CHAR( 70 ) NULL DEFAULT NULL ;"
172172

173-
173+
cd /root
174174
wget https://raw.githubusercontent.com/magnussolution/magnusbilling7/source/script/sync_opensips_reload.sh
175175

176176
chmod +x sync_opensips_reload.sh
177177

178-
echo "
179-
* * * * * root /root/sync_opensips_reload.sh
180-
" >> /etc/crontab
178+
grep -q "/root/sync_opensips_reload.sh" /etc/crontab || echo "* * * * * root flock -n /tmp/sync_opensips.lock /root/sync_opensips_reload.sh" >> /etc/crontab
181179

182180

183181
cd /etc/opensips/
@@ -248,7 +246,7 @@ systemctl start firewalld
248246
systemctl enable firewalld
249247
systemctl enable fail2ban
250248

251-
249+
firewall-cmd --zone=public --add-port=$ssh_port/tcp --permanent
252250
firewall-cmd --zone=public --add-port=22/tcp --permanent
253251
firewall-cmd --zone=public --add-port=80/tcp --permanent
254252
firewall-cmd --zone=public --add-port=443/tcp --permanent

0 commit comments

Comments
 (0)