调整发送/上报相关状态; 接口调用账户验证; 导游上报后录入是否成功状态; 增加测试入口
parent
dd400c60e2
commit
1bd077bf52
@ -0,0 +1,58 @@
|
||||
<?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_Direction
|
||||
* 1 外部调用我社系统
|
||||
* 2 我社调用外部系统
|
||||
*
|
||||
* TPA_AccountType
|
||||
* - 1* 外部调用我社系统
|
||||
* - 11 地接社
|
||||
* - 2* 我社调用外部系统
|
||||
* - 21 所属小组
|
||||
*
|
||||
*/
|
||||
|
||||
public function get_user_key($account_id, $account_type, $direction)
|
||||
{
|
||||
$sql = "SELECT *
|
||||
FROM [Tourmanager].[dbo].[ThirdPartyAuth]
|
||||
where TPA_Direction=?
|
||||
and TPA_AccountType=?
|
||||
and TPA_AccountID=?
|
||||
order by TPA_ExpiredTime desc ";
|
||||
return $this->HT->query($sql, array($direction, $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, $direction=1)
|
||||
{
|
||||
$sql = "SELECT tpa_sn
|
||||
FROM [Tourmanager].[dbo].[ThirdPartyAuth]
|
||||
where tpa_direction=?
|
||||
and TPA_AccountType=?
|
||||
and tpa_openid=?
|
||||
and tpa_openkey=?
|
||||
";
|
||||
return ($this->HT->query($sql, array($direction, $account_type, $open_id, $open_key))->num_rows() > 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file UserAuth_model.php */
|
||||
/* Location: ./third_party/vendorPlanSync/models/UserAuth_model.php */
|
Loading…
Reference in New Issue