You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
payment/app/Model/RequestLog.php

27 lines
570 B
PHTML

1 year ago
<?php
declare(strict_types=1);
namespace App\Model;
class RequestLog extends Model
{
protected $table = 'request_logs';
1 year ago
public function generateToken() {
return md5($this->app_id . '_' . $this->request_id);
}
public function getDataValue($key, $defaultValue = null) {
$data = $this->getData();
return $data[$key] ?: $defaultValue;
}
public function getData() {
$data = $this->request_data['data'] ?: null;
if ($data) {
return json_decode($data, true);
}
return [];
}
1 year ago
}