1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-07-16 21:26:13 +08:00
course-tencent-cloud/app/Models/AccountBind.php
xiaochong0302 cf5e50f402 增加第三方登录设计
整理代码
2020-04-16 19:29:09 +08:00

94 lines
1.3 KiB
PHP

<?php
namespace App\Models;
use Phalcon\Mvc\Model\Behavior\SoftDelete;
class AccountBind extends Model
{
/**
* 服务商类型
*/
const PROVIDER_QQ = 'qq';
const PROVIDER_WEIXIN = 'weixin';
const PROVIDER_WEIBO = 'weibo';
/**
* 主键编号
*
* @var int
*/
public $id;
/**
* 服务商
*
* @var string
*/
public $provider;
/**
* 外部用户编号
*
* @var string
*/
public $open_id;
/**
* 内部用户编号
*
* @var int
*/
public $user_id;
/**
* 删除标识
*
* @var int
*/
public $deleted;
/**
* 创建时间
*
* @var int
*/
public $create_time;
/**
* 更新时间
*
* @var int
*/
public $update_time;
public function getSource()
{
return 'kg_account_bind';
}
public function initialize()
{
parent::initialize();
$this->addBehavior(
new SoftDelete([
'field' => 'deleted',
'value' => 1,
])
);
}
public function beforeCreate()
{
$this->create_time = time();
}
public function beforeUpdate()
{
$this->update_time = time();
}
}