<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-present http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\user\model;

use app\user\service\UserService;
use think\Model;

class UserModel extends Model
{
    /**
     * 模型名称
     * @var string
     */
    protected $name = 'user';

    protected $type = [
        'more' => 'array',
    ];

    /**
     * @param $user
     * @return int
     * @deprecated
     */
    public function doMobile($user)
    {
        return UserService::doMobile($user);
    }

    /**
     * @param $user
     * @return int
     * @deprecated
     */
    public function doName($user)
    {
        return UserService::doName($user);
    }

    /**
     * @param $user
     * @return int
     * @deprecated
     */
    public function doEmail($user)
    {
        return UserService::doEmail($user);
    }

    /**
     * @param $user
     * @param $type
     * @return int
     * @deprecated
     */
    public function register($user, $type)
    {
        return UserService::register($user, $type);
    }

    /**
     * 通过邮箱重置密码
     * @param $email
     * @param $password
     * @return int
     * @deprecated
     */
    public function emailPasswordReset($email, $password)
    {
        return UserService::emailPasswordReset($email, $password);
    }

    /**
     * 通过手机重置密码
     * @param $mobile
     * @param $password
     * @return int
     * @deprecated
     */
    public function mobilePasswordReset($mobile, $password)
    {
        return UserService::mobilePasswordReset($mobile, $password);
    }

    /**
     * @param $user
     * @param $field
     * @return int
     * @deprecated
     */
    public function editData($user, $field = [])
    {
        return UserService::editData($user, $field);
    }

    /**
     * 用户密码修改
     * @param $user
     * @return int
     * @deprecated
     */
    public function editPassword($user)
    {
        return UserService::editPassword($user);
    }

    /**
     * 绑定用户手机号
     * @deprecated
     */
    public function bindingMobile($user)
    {
        return UserService::bindingMobile($user);
    }

    /**
     * 绑定用户邮箱
     * @deprecated
     */
    public function bindingEmail($user)
    {
        return UserService::bindingEmail($user);
    }
}