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.
information-system/webht/third_party/vendorPlanSync/models/UserAuth_model.php

53 lines
1.5 KiB
PHP

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class UserAuth_model extends CI_Model {
function __construct() {
parent::__construct();
$this->HT = $this->load->database('HT', TRUE);
}
/*!
*
* TPA_AccountType
* - 1 地接社
*
*/
public function get_user_key($account_id, $account_type)
{
$sql = "SELECT *
FROM [Tourmanager].[dbo].[ThirdPartyAuth]
where 1=1
and TPA_AccountType=?
and TPA_AccountID=?
order by TPA_ExpiredTime desc ";
return $this->HT->query($sql, array($account_type, $account_id))->row();
}
/*!
* 验证openID,openKey是否有效
* @date 2018-11-29
* @param int $open_id
* @param string $open_key
* @param integer $direction 默认是1-外部调用
* @return boolean
*/
public function if_user_key($open_id, $open_key, $account_type)
{
$sql = "SELECT tpa_sn
FROM [Tourmanager].[dbo].[ThirdPartyAuth]
where 1=1
and TPA_AccountType=?
and TPA_OpenId=?
and TPA_OpenKey=?
";
return ($this->HT->query($sql, array($account_type, $open_id, $open_key))->num_rows() > 0);
}
}
/* End of file UserAuth_model.php */
/* Location: ./third_party/vendorPlanSync/models/UserAuth_model.php */