This repository has been archived on 2024-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
yoshop/source/application/admin/model/store/User.php

43 lines
907 B
PHP
Raw Normal View History

2020-04-25 22:20:29 +08:00
<?php
namespace app\admin\model\store;
use app\common\model\store\User as StoreUserModel;
/**
* 商家用户模型
* Class StoreUser
* @package app\admin\model
*/
class User extends StoreUserModel
{
/**
* 新增商家用户记录
* @param $wxapp_id
* @param $data
* @return bool|false|int
*/
public function add($wxapp_id, $data)
{
return $this->save([
'user_name' => $data['user_name'],
'password' => yoshop_hash($data['password']),
'wxapp_id' => $wxapp_id,
]);
}
/**
* 商家用户登录
* @param $wxapp_id
* @throws \think\Exception
* @throws \think\exception\DbException
*/
public function login($wxapp_id)
{
// 验证用户名密码是否正确
$user = self::detail(['wxapp_id' => $wxapp_id], ['wxapp']);
$this->loginState($user);
}
}