Added contract_id to Voicecallhistory
This commit is contained in:
@@ -8,7 +8,6 @@ class VoiceCallHistoryModel {
|
||||
public $billable;
|
||||
public $duration;
|
||||
|
||||
|
||||
public function __construct($data = []) {
|
||||
foreach ($data as $field => $value) {
|
||||
if (property_exists(get_called_class(), $field)) {
|
||||
@@ -58,7 +57,14 @@ class VoiceCallHistoryModel {
|
||||
public static function importVoiceCallHistory($callHistory): array {
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$sql = /** @lang text */ "INSERT INTO `VoiceCallHistory` (`uid`, `voice_account`, `start`, `source`, `destination`, `state`, `billable`, `duration`) VALUES ";
|
||||
$me = mfValuecache::singleton()->get("me");
|
||||
if(!$me) {
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
mfValuecache::singleton()->set("me", $me);
|
||||
}
|
||||
|
||||
$sql = /** @lang text */ "INSERT INTO `VoiceCallHistory` (`uid`, `voice_account`, `start`, `source`, `destination`, `state`, `billable`, `duration`, `create_by`, `edit_by`, `create`, `edit`) VALUES ";
|
||||
$values = [];
|
||||
foreach ($callHistory as $voiceCall) {
|
||||
$uid = $voiceCall['uid'];
|
||||
@@ -70,7 +76,12 @@ class VoiceCallHistoryModel {
|
||||
($voiceCall['destination'] === 'Anonymous' ? "NULL" : $voiceCall['destination'] ) . "', " .
|
||||
$voiceCall['state'] . ", " .
|
||||
$voiceCall['billable'] . ", " .
|
||||
$voiceCall['duration'] . ")";
|
||||
$voiceCall['duration'] . ", ".
|
||||
|
||||
$me->id . ", ".
|
||||
$me->id . ", ".
|
||||
date("U") . ", ".
|
||||
date("U") . ")";
|
||||
|
||||
$values[] = $valueStr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user