You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.2 KiB

<?php
namespace app\base\model\platform;
use think\model\concern\SoftDelete;
class PlatformZixishi extends Base
{
use SoftDelete;
// 设置当前模型对应的完整数据表名称
protected $table = 'base_platform_zixishi';
/**
* 获取支参数配置
* @date 2022-11-21
*/
public function getPlatformParam()
{
$where = [
['uid', '=', $this->mid]
];
$field = 'api_id,api_key';
return $this->getOneData($where, $field);
}
/**
* 获取token
* @date 2022-11-21
*/
public function getAccessToken()
{
$where = [
['uid', '=', $this->mid]
];
$field = 'access_token,access_token_time';
return $this->getOneData($where, $field);
}
/**
* 更新token
* @param string $access_token token
* @param int $access_token_time token过期时间
* @date 2022-11-21
*/
public function updateAccessToken($access_token, $access_token_time)
{
$data = [
'access_token' => $access_token,
'access_token_time' => $access_token_time
];
return $this->dataUpdate($data, [
['uid', '=', $this->mid]
]);
}
}