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.
59 lines
1.2 KiB
59 lines
1.2 KiB
<?php
|
|
|
|
namespace app\base\model\user;
|
|
|
|
use app\base\model\Base;
|
|
use think\model\concern\SoftDelete;
|
|
|
|
|
|
class UserAlipay extends Base
|
|
{
|
|
|
|
use SoftDelete;
|
|
|
|
// 设置当前模型对应的完整数据表名称
|
|
protected $table = 'base_user_alipay';
|
|
|
|
/**
|
|
* 更新用户支付宝信息
|
|
* @param array $data 用户信息
|
|
* @date 2021-10-28
|
|
*/
|
|
public function updateInfo($data)
|
|
{
|
|
$where = [
|
|
['user_id', '=', $data['user_id']]
|
|
];
|
|
$id = $this->getOneData($where, 'id');
|
|
|
|
if (!empty($id)) {
|
|
$data['id'] = $id;
|
|
}
|
|
|
|
return $this->dataUpdate($data);
|
|
}
|
|
|
|
/**
|
|
* 是否绑定支付宝信息
|
|
* @param string $user_id user_id
|
|
* @return integer 0--未绑定 1--已绑定
|
|
* @date 2022-05-25
|
|
*/
|
|
public function isBindAliPay($user_id = '')
|
|
{
|
|
//没有传user_id时默认当前用户
|
|
if(empty($user_id)){
|
|
$user_id = $this->userId;
|
|
}
|
|
|
|
$where = [
|
|
['user_id', '=', $user_id]
|
|
];
|
|
$alipay_account = $this->getOneData($where, 'account');
|
|
|
|
return empty($alipay_account) ? 0 : 1;
|
|
}
|
|
|
|
|
|
}
|