~~~
<?php
namespace app\index\model;
use app\common\sdk\PassHash;
class User extends Model
{
protected $connection = ['prefix' => 'acc_dragon_'];
/**
* 初始化
* @return void
*/
protected function initialize()
{
parent::initialize();
$this->table = 'acc_dragon_user';
}
/**
* 加密修改器
* @param string $value 加密口令
*/
public function setPassAttr($value)
{
return PassHash::authcode($value, 'ENCODE', $this->key);
}
}
~~~