|
|
|
@ -127,6 +127,7 @@ class User extends Model{
|
|
|
|
|
'delay_time' =>0,
|
|
|
|
|
'avatar' => "default",
|
|
|
|
|
'profile' => true,
|
|
|
|
|
'options' => "{}",
|
|
|
|
|
];
|
|
|
|
|
if(Db::name('users')->insert($sqlData)){
|
|
|
|
|
$userId = Db::name('users')->getLastInsID();
|
|
|
|
@ -355,6 +356,13 @@ class User extends Model{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function changeOption($optionKey,$optionValue){
|
|
|
|
|
$options = json_decode($this->userSQLData["options"],true);
|
|
|
|
|
$options[$optionKey] = $optionValue;
|
|
|
|
|
Db::name("users")->where("id",$this->uid)->update(["options" => json_encode($options)]);
|
|
|
|
|
return [1,1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function changePwd($origin,$new){
|
|
|
|
|
if(md5(config('salt').$origin) != $this->userSQLData["user_pass"]){
|
|
|
|
|
return [0,"原密码错误"];
|
|
|
|
|