VoiceCallHistoryController::addContractIds() storing ignore nums in db

This commit is contained in:
Frank Schubert
2026-02-03 14:33:35 +01:00
parent 00926fe3bd
commit cf88bef333
2 changed files with 40 additions and 52 deletions

View File

@@ -95,69 +95,26 @@ class VoiceCallHistoryController extends mfBaseController {
} }
public function addContractIds() { public function addContractIds() {
// regex format $ign = new mfConfig("voicecallhistory.contractadd.ignore_numbers");
$ignore_numbers = [ $ignore_numbers = $ign->value();
"^43664",
"^43677", if($ignore_numbers) $ignore_numbers = json_decode($ignore_numbers);
"^43699", if(!is_array($ignore_numbers)) {
"^43660", $ignore_numbers = [];
"^43676", }
"^43650",
"^4331641220846$",
"^43623237705$",
"^4367761737195$",
"^43216720836$",
"^43623237705$",
"^43318528468150$",
"^4312532516$",
"^43720729927$",
"^4334528240030$",
"^4350144522120$",
"^4315460050680$",
"^491795058290$",
"^43346221888$",
"^43346244112609$",
"^43345271487$",
"^43318523364$",
"^4953118053397$",
"^433169010$",
"^433163130$",
"^43345276276$",
"^4371119$",
"^4331638513208$",
"^4350808808$",
"^4334562244$",
"^4331638579635$",
"^4334527015385$",
"^4331852888$",
"^436604721650$",
"^43316465611$",
"^43318255088$",
"^433452853656$",
"^4312661274381$",
"^4334528682432$",
"^38640616165",
"^43676848456202$",
"^43136157650",
"^43317244160",
"^4368181877218",
"^491744919930",
"^4924194559562",
];
$unknown_numbers = []; $unknown_numbers = [];
$in_order = []; $in_order = [];
$missing_contracts = []; $missing_contracts = [];
$update_job_error = false; $update_job_error = false;
$last_calls = VoiceCallHistoryModel::getVoiceCallHistoryAsEntity([[], 1, 0, ["key" => "create", "order" => "DESC"]]); $last_calls = VoiceCallHistoryModel::getVoiceCallHistoryAsEntity([[]], 1, 0, ["key" => "create", "order" => "DESC"]);
$last_call = $last_calls[0]; $last_call = $last_calls[0];
if($last_call->create < date("U") - 86400) { if($last_call->create < date("U") - 86400) {
$update_job_error = $last_call->create; $update_job_error = $last_call->create;
return false; return false;
} }
// get calls without contract id // get calls without contract id
foreach(VoiceCallHistoryModel::getVoiceCallHistoryAsEntity(["contract_id" => null, "billable" => "1", "duration" => ["from" => 1]]) as $call) { foreach(VoiceCallHistoryModel::getVoiceCallHistoryAsEntity(["contract_id" => null, "billable" => "1", "duration" => ["from" => 1]]) as $call) {
//var_dump($call);exit; //var_dump($call);exit;

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class SystemChangeValueText extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table('System');
$table->changeColumn("value", "text", ["null" => false, "length" => Phinx\Db\Adapter\MysqlAdapter::TEXT_MEDIUM]);
$table->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
}
if($this->getEnvironment() == "addressdb") {
}
}
}