1、合作商余额查询
2、分油账户司机可用额度
This commit is contained in:
@@ -17,6 +17,7 @@ use app\api\model\User as UserModel;
|
||||
use app\api\model\UserCoupon as UserCouponModel;
|
||||
use app\api\service\User as UserService;
|
||||
use cores\exception\BaseException;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 用户管理
|
||||
@@ -76,6 +77,46 @@ class User extends Controller
|
||||
return $this->renderSuccess('恭喜您,手机号绑定成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 实名信息(姓名 / 身份证号 / 车牌号)
|
||||
*
|
||||
* 分油实名制:上游分油前做「姓名 + 身份证号」二要素认证,所以下单前必须补全。
|
||||
* 车牌号只在本地留存与后台展示,不上送上游。
|
||||
* @return Json
|
||||
* @throws BaseException
|
||||
*/
|
||||
public function realname(): Json
|
||||
{
|
||||
$userInfo = UserService::getCurrentLoginUser(true);
|
||||
return $this->renderSuccess([
|
||||
'realname' => [
|
||||
'realName' => (string)$userInfo['real_name'],
|
||||
'idCard' => (string)$userInfo['id_card'],
|
||||
'plateNo' => (string)$userInfo['plate_no'],
|
||||
// 身份证号已用于分油后不允许再改(上游按身份证号累计司机额度)
|
||||
'idCardLocked' => (string)$userInfo['id_card'] !== '' && Db::name('partners_order')
|
||||
->where('user_id', '=', (int)$userInfo['user_id'])
|
||||
->where('source', '=', 'mall')
|
||||
->count() > 0,
|
||||
'isReady' => UserModel::isRealnameReady($userInfo),
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存实名信息
|
||||
* @return Json
|
||||
* @throws BaseException
|
||||
*/
|
||||
public function saveRealname(): Json
|
||||
{
|
||||
$model = new UserModel;
|
||||
if (!$model->realname($this->postForm())) {
|
||||
return $this->renderError($model->getError() ?: '保存失败');
|
||||
}
|
||||
return $this->renderSuccess('保存成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改个人信息(头像昵称)
|
||||
* @return Json
|
||||
|
||||
Reference in New Issue
Block a user