<?php
namespace app\admin\model\store;
use app\common\model\store\User as StoreUserModel;
class User extends StoreUserModel
{
public function add($wxapp_id, $data)
{
if (self::checkExist($data['user_name'])) {
$this->error = '商家用户名已存在';
return false;
}
return $this->save([
'user_name' => $data['user_name'],
'password' => yoshop_hash($data['password']),
'wxapp_id' => $wxapp_id,
]);
}
public function login($wxapp_id)
{
$user = self::detail(['wxapp_id' => $wxapp_id], ['wxapp']);
$this->loginState($user);
}
}