You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.1 KiB

<?php
namespace app\base\model\mpalipay;
use app\base\model\Base;
use think\model\concern\SoftDelete;
class MpalipayUser extends Base
{
use SoftDelete;
// 设置当前模型对应的完整数据表名称
protected $table = 'base_mpalipay_user';
/**
* 更新小程序用户信息
* @param array $data 小程序用户信息
* @date 2022-03-25
*/
public function updateUser($data)
{
$where = [
['openid', '=', $data['openid']]
];
$id = $this->getOneData($where, 'id');
if (!empty($id)) {
$data['id'] = $id;
}
return $this->dataUpdate($data);
}
/**
* 解除三方授权绑定
* @param integer $user_id USER_ID
* @date 2022-03-25
*/
public function unbindPlatform($user_id)
{
$where = [
['user_id', '=', $user_id]
];
$id = $this->getOneData($where, 'id');
if (!empty($id)) {
$data['id'] = $id;
$data['user_id'] = 0;
return $this->dataUpdate($data);
} else {
return true;
}
}
}