2024-05-30 21:37:55 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace app\api\controller\user;
|
|
|
|
|
|
|
|
|
|
use app\api\controller\BaseApiController;
|
2024-07-02 14:30:20 +08:00
|
|
|
|
use app\api\lists\user_sign\UserSignLists;
|
|
|
|
|
use app\api\lists\user_sign_log\UserSignLogLists;
|
2024-05-30 21:37:55 +08:00
|
|
|
|
use app\api\logic\user\UserLogic;
|
2024-06-25 15:05:58 +08:00
|
|
|
|
use app\api\service\UserTokenService;
|
2024-05-30 21:37:55 +08:00
|
|
|
|
use app\api\validate\UserValidate;
|
2024-06-04 23:15:30 +08:00
|
|
|
|
use app\common\enum\PayEnum;
|
2024-08-14 18:00:22 +08:00
|
|
|
|
use app\common\logic\CapitalFlowLogic;
|
2024-06-04 23:15:30 +08:00
|
|
|
|
use app\common\logic\PaymentLogic;
|
2024-08-05 17:47:51 +08:00
|
|
|
|
use app\common\model\store_extract\StoreExtract;
|
2024-06-24 16:30:25 +08:00
|
|
|
|
use app\common\model\user\User;
|
2024-06-28 14:26:39 +08:00
|
|
|
|
use app\common\model\user\UserAddress;
|
2024-07-01 18:03:43 +08:00
|
|
|
|
use app\common\model\user_ship\UserShip;
|
2024-06-24 16:30:25 +08:00
|
|
|
|
use app\common\model\user_sign\UserSign;
|
2024-06-21 11:23:08 +08:00
|
|
|
|
use support\Cache;
|
|
|
|
|
use think\Exception;
|
2024-06-28 15:10:23 +08:00
|
|
|
|
use think\facade\Db;
|
2024-05-30 21:37:55 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 用户控制器
|
|
|
|
|
* Class UserController
|
|
|
|
|
* @package app\api\controller
|
|
|
|
|
*/
|
|
|
|
|
class UserController extends BaseApiController
|
|
|
|
|
{
|
2024-06-22 17:15:46 +08:00
|
|
|
|
public $notNeedLogin = ['login_sms'];
|
2024-06-14 15:53:47 +08:00
|
|
|
|
// #[
|
|
|
|
|
// ApiDoc\Title('获取小程序手机号'),
|
|
|
|
|
// ApiDoc\url('/api/user/user/getMobileByMnp'),
|
|
|
|
|
// ApiDoc\Method('POST'),
|
|
|
|
|
// ApiDoc\Param(name: "code", type: "string", require: true, desc: "换取手机的code"),
|
|
|
|
|
// ApiDoc\NotHeaders(),
|
|
|
|
|
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
|
|
|
|
|
// ApiDoc\ResponseSuccess("data", type: "array"),
|
|
|
|
|
// ]
|
2024-05-30 21:37:55 +08:00
|
|
|
|
public function getMobileByMnp()
|
|
|
|
|
{
|
|
|
|
|
$params = (new UserValidate())->post()->goCheck('getMobileByMnp');
|
|
|
|
|
$params['user_id'] = $this->userId;
|
|
|
|
|
$result = UserLogic::getMobileByMnp($params);
|
|
|
|
|
if ($result === false) {
|
|
|
|
|
return $this->fail(UserLogic::getError());
|
|
|
|
|
}
|
2024-08-05 17:47:51 +08:00
|
|
|
|
if ($result && is_numeric($result)) {
|
2024-06-25 15:05:58 +08:00
|
|
|
|
$data = UserLogic::info($result);
|
|
|
|
|
$userInfo = UserTokenService::setToken($result, 1);
|
|
|
|
|
$data['token'] = $userInfo['token'];
|
2024-08-05 17:47:51 +08:00
|
|
|
|
} else {
|
2024-06-25 15:05:58 +08:00
|
|
|
|
$data = UserLogic::info($this->userId);
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-04 15:26:45 +08:00
|
|
|
|
return $this->success('绑定成功', $data, 1, 1);
|
2024-05-30 21:37:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-06-14 15:53:47 +08:00
|
|
|
|
// #[
|
|
|
|
|
// ApiDoc\Title('用户个人信息'),
|
|
|
|
|
// ApiDoc\url('/api/user/user/info'),
|
|
|
|
|
// ApiDoc\Method('POST'),
|
|
|
|
|
// ApiDoc\Param(),
|
|
|
|
|
// ApiDoc\NotHeaders(),
|
|
|
|
|
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
|
|
|
|
|
// ApiDoc\ResponseSuccess("data", type: "array"),
|
|
|
|
|
// ]
|
2024-06-04 11:12:28 +08:00
|
|
|
|
public function info()
|
|
|
|
|
{
|
2024-08-19 20:42:31 +08:00
|
|
|
|
$params=$this->request->post();
|
|
|
|
|
return $this->success('success', UserLogic::info($this->userId,$params));
|
2024-06-04 11:12:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-06-14 15:53:47 +08:00
|
|
|
|
// #[
|
|
|
|
|
// ApiDoc\Title('充值金额'),
|
|
|
|
|
// ApiDoc\url('/api/user/user/rechange_amount'),
|
|
|
|
|
// ApiDoc\Method('Get'),
|
|
|
|
|
// ApiDoc\Param(),
|
|
|
|
|
// ApiDoc\NotHeaders(),
|
|
|
|
|
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
|
|
|
|
|
// ApiDoc\ResponseSuccess("data", type: "array"),
|
|
|
|
|
// ]
|
2024-06-06 11:53:38 +08:00
|
|
|
|
public function rechange_amount()
|
|
|
|
|
{
|
|
|
|
|
$res = UserLogic::rechange_level();
|
2024-08-05 17:47:51 +08:00
|
|
|
|
return $this->success('ok', $res);
|
2024-06-06 11:53:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-06-14 15:53:47 +08:00
|
|
|
|
// #[
|
|
|
|
|
// ApiDoc\Title('小程序充值'),
|
|
|
|
|
// ApiDoc\url('/api/user/user/recharge'),
|
|
|
|
|
// ApiDoc\Method('POST'),
|
|
|
|
|
// ApiDoc\Param(name: "price", type: "string", require: true, desc: "金额"),
|
|
|
|
|
// ApiDoc\NotHeaders(),
|
|
|
|
|
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
|
|
|
|
|
// ApiDoc\ResponseSuccess("data", type: "array"),
|
|
|
|
|
// ]
|
2024-06-04 23:15:30 +08:00
|
|
|
|
public function recharge()
|
|
|
|
|
{
|
|
|
|
|
$params = (new UserValidate())->post()->goCheck('rechargeMoney');
|
|
|
|
|
$params['uid'] = $this->userId;
|
|
|
|
|
$params['channel_type'] = $this->userInfo['terminal'];
|
|
|
|
|
$order = UserLogic::recharge($params);
|
|
|
|
|
$redirectUrl = $params['redirect'] ?? '/pages/payment/payment';
|
2024-06-08 21:10:06 +08:00
|
|
|
|
$result = PaymentLogic::pay(PayEnum::WECHAT_PAY_MINI, 'recharge', $order, $this->userInfo['terminal'], $redirectUrl);
|
2024-06-04 23:15:30 +08:00
|
|
|
|
if (PaymentLogic::hasError()) {
|
|
|
|
|
return $this->fail(PaymentLogic::getError(), $params);
|
|
|
|
|
}
|
|
|
|
|
return $this->success('', $result);
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-14 15:53:47 +08:00
|
|
|
|
// #[
|
|
|
|
|
// ApiDoc\Title('会员账户详情'),
|
|
|
|
|
// ApiDoc\url('/api/user/user/capital_flow'),
|
|
|
|
|
// ApiDoc\Method('POST'),
|
|
|
|
|
// ApiDoc\Param(name: "page_no", type: "int", require: true, desc: "默认1页数"),
|
|
|
|
|
// ApiDoc\Param(name: "page_size", type: "int", require: false, desc: "条数默认15"),
|
|
|
|
|
// ApiDoc\NotHeaders(),
|
|
|
|
|
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
|
|
|
|
|
// ApiDoc\ResponseSuccess("data", type: "array"),
|
|
|
|
|
// ]
|
2024-06-06 11:34:26 +08:00
|
|
|
|
public function capital_flow()
|
|
|
|
|
{
|
2024-08-05 17:47:51 +08:00
|
|
|
|
$page_no = (int)$this->request->post('page_no', 1);
|
|
|
|
|
$page_size = (int)$this->request->post('page_size', 15);
|
2024-06-06 11:34:26 +08:00
|
|
|
|
$params['page_no'] = $page_no;
|
|
|
|
|
$params['page_size'] = $page_size;
|
2024-08-05 17:47:51 +08:00
|
|
|
|
if (empty($page_no) || empty($page_size)) {
|
2024-06-06 11:34:26 +08:00
|
|
|
|
$params['page_no'] = 1;
|
|
|
|
|
$params['page_size'] = 15;
|
|
|
|
|
}
|
2024-08-05 17:47:51 +08:00
|
|
|
|
$res = UserLogic::capital_list($this->userId, $params);
|
2024-06-06 11:34:26 +08:00
|
|
|
|
|
2024-08-05 17:47:51 +08:00
|
|
|
|
$res['page_no'] = $params['page_no'];
|
|
|
|
|
$res['page_size'] = $params['page_size'];
|
|
|
|
|
return $this->success('ok', $res);
|
2024-06-06 11:34:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-06-14 15:53:47 +08:00
|
|
|
|
// #[
|
|
|
|
|
// ApiDoc\Title('会员账户统计'),
|
|
|
|
|
// ApiDoc\url('/api/user/user/capital_count'),
|
|
|
|
|
// ApiDoc\Method('POST'),
|
|
|
|
|
// ApiDoc\Param(),
|
|
|
|
|
// ApiDoc\NotHeaders(),
|
|
|
|
|
// ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
|
|
|
|
|
// ApiDoc\ResponseSuccess("data", type: "array"),
|
|
|
|
|
// ]
|
2024-06-06 11:34:26 +08:00
|
|
|
|
public function capital_count()
|
|
|
|
|
{
|
|
|
|
|
$res = UserLogic::capital_count($this->userId);
|
2024-08-05 17:47:51 +08:00
|
|
|
|
return $this->success('ok', $res);
|
2024-06-06 11:34:26 +08:00
|
|
|
|
}
|
2024-06-04 11:12:28 +08:00
|
|
|
|
|
2024-06-21 11:23:08 +08:00
|
|
|
|
public function send_sms()
|
|
|
|
|
{
|
|
|
|
|
$res = (new UserLogic())->dealSendSms($this->userId);
|
2024-08-05 17:47:51 +08:00
|
|
|
|
if ($res) {
|
2024-06-21 11:23:08 +08:00
|
|
|
|
return $this->success('发送成功');
|
|
|
|
|
}
|
|
|
|
|
return $this->fail('发送失败');
|
|
|
|
|
}
|
2024-06-22 17:15:46 +08:00
|
|
|
|
|
2024-06-25 09:46:16 +08:00
|
|
|
|
//登录
|
2024-06-22 17:15:46 +08:00
|
|
|
|
public function login_sms()
|
|
|
|
|
{
|
|
|
|
|
$params = (new UserValidate())->post()->goCheck('login');
|
|
|
|
|
$res = (new UserLogic())->dealLoginSms($params['account']);
|
2024-08-05 17:47:51 +08:00
|
|
|
|
if ($res) {
|
2024-06-22 17:15:46 +08:00
|
|
|
|
return $this->success('发送成功');
|
|
|
|
|
}
|
|
|
|
|
return $this->fail('发送失败');
|
|
|
|
|
}
|
2024-06-25 09:46:16 +08:00
|
|
|
|
|
|
|
|
|
//报备
|
|
|
|
|
public function reporting_sms()
|
|
|
|
|
{
|
|
|
|
|
$params = (new UserValidate())->post()->goCheck('login');
|
|
|
|
|
$res = (new UserLogic())->dealReportingSms($params['account']);
|
2024-08-05 17:47:51 +08:00
|
|
|
|
if ($res) {
|
|
|
|
|
return $this->success('发送成功', [], 1, 1);
|
2024-06-25 09:46:16 +08:00
|
|
|
|
}
|
|
|
|
|
return $this->fail('发送失败');
|
|
|
|
|
}
|
2024-08-05 17:47:51 +08:00
|
|
|
|
|
|
|
|
|
|
2024-06-21 11:23:08 +08:00
|
|
|
|
|
|
|
|
|
public function set_payPassword()
|
|
|
|
|
{
|
|
|
|
|
$params = (new UserValidate())->post()->goCheck('setPayPassword');
|
2024-08-05 17:47:51 +08:00
|
|
|
|
$remark = $this->userId . '_payPassword';
|
2024-06-21 11:23:08 +08:00
|
|
|
|
$code = Cache::get($remark);
|
|
|
|
|
if ($code && isset($params['code']) && $code !== $params['code']) {
|
2024-06-26 18:27:36 +08:00
|
|
|
|
return $this->fail('验证码错误');
|
2024-06-21 11:23:08 +08:00
|
|
|
|
}
|
|
|
|
|
if ($params['rePassword'] !== $params['password'])
|
|
|
|
|
return $this->fail('两次密码不一致');
|
2024-08-05 17:47:51 +08:00
|
|
|
|
$result = UserLogic::dealPayPassword($params, $this->userId);
|
2024-06-21 11:23:08 +08:00
|
|
|
|
if (!$result) {
|
|
|
|
|
return $this->fail('设置失败');
|
|
|
|
|
}
|
|
|
|
|
return $this->success('设置成功');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//修改
|
2024-08-05 17:47:51 +08:00
|
|
|
|
// public function withdrawalPassword()
|
|
|
|
|
// {
|
|
|
|
|
// $data = $this->request->params(['repassword', 'password', 'sms_code']);
|
|
|
|
|
// $sms_code = app()->make(SmsService::class)->checkSmsCode($this->user->phone, $data['sms_code'], 'change_pwd');
|
|
|
|
|
// if (!$data['sms_code'] || !$sms_code) {
|
|
|
|
|
// return app('json')->fail('验证码不正确');
|
|
|
|
|
// }
|
|
|
|
|
// if (!$this->user->phone)
|
|
|
|
|
// return app('json')->fail('请先绑定手机号');
|
|
|
|
|
// if (empty($data['repassword']) || empty($data['password']))
|
|
|
|
|
// return app('json')->fail('请输入提现密码');
|
|
|
|
|
// if ($data['repassword'] !== $data['password'])
|
|
|
|
|
// return app('json')->fail('两次密码不一致');
|
|
|
|
|
// $password = $this->repository->encodePassword($data['password']);
|
|
|
|
|
// $this->repository->update($this->request->uid(), ['withdrawal_pwd' => $password]);
|
|
|
|
|
// return app('json')->success('绑定成功');
|
|
|
|
|
//
|
|
|
|
|
// }
|
2024-06-21 11:23:08 +08:00
|
|
|
|
|
2024-06-22 14:25:32 +08:00
|
|
|
|
//采购款明细、余额明细、礼品券明细、返还金明细
|
|
|
|
|
public function fundList()
|
|
|
|
|
{
|
|
|
|
|
(new UserValidate())->get()->goCheck('fund');
|
|
|
|
|
$page_no = (int)$this->request->get('page_no', 1);
|
|
|
|
|
$page_size = (int)$this->request->get('page_size', 15);
|
|
|
|
|
$params = $this->request->get();
|
|
|
|
|
$params['page_no'] = $page_no > 0 ? $page_no : 1;
|
|
|
|
|
$params['page_size'] = $page_size > 0 ? $page_size : 15;
|
2024-08-05 17:47:51 +08:00
|
|
|
|
$res = UserLogic::dealDetails($params, $this->userId);
|
|
|
|
|
$integral = User::where('id', $this->userId)->value('integral');
|
|
|
|
|
$number = UserSign::where('id', $this->userId)->where('status', 0)->sum('number');
|
|
|
|
|
$GetNumber = UserSign::where('id', $this->userId)->where('status', 1)->sum('number');
|
2024-06-22 14:25:32 +08:00
|
|
|
|
$res['page_no'] = $params['page_no'];
|
|
|
|
|
$res['page_size'] = $params['page_size'];
|
2024-06-24 16:30:25 +08:00
|
|
|
|
$res['extend'] = [
|
2024-08-05 17:47:51 +08:00
|
|
|
|
'integral' => $integral,
|
|
|
|
|
'number' => $number,
|
|
|
|
|
'get_number' => $GetNumber
|
2024-06-24 16:30:25 +08:00
|
|
|
|
];
|
2024-06-22 14:25:32 +08:00
|
|
|
|
return $this->success('ok', $res);
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-02 14:30:20 +08:00
|
|
|
|
/**
|
|
|
|
|
* 礼品券/冻结券
|
|
|
|
|
*/
|
2024-06-29 13:49:48 +08:00
|
|
|
|
public function userSing()
|
|
|
|
|
{
|
|
|
|
|
(new UserValidate())->get()->goCheck('fund');
|
2024-07-02 14:30:20 +08:00
|
|
|
|
$type = (int)$this->request->get('type', 1);
|
2024-08-05 17:47:51 +08:00
|
|
|
|
if ($type == 1) {
|
2024-07-02 14:30:20 +08:00
|
|
|
|
return $this->dataLists(new UserSignLists());
|
2024-08-05 17:47:51 +08:00
|
|
|
|
} else {
|
2024-07-02 14:30:20 +08:00
|
|
|
|
return $this->dataLists(new UserSignLogLists());
|
|
|
|
|
}
|
2024-06-29 13:49:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-06-28 14:26:39 +08:00
|
|
|
|
/**
|
|
|
|
|
* 用户信息
|
|
|
|
|
*/
|
2024-08-05 17:47:51 +08:00
|
|
|
|
public function other_user_info()
|
|
|
|
|
{
|
|
|
|
|
$mobile = $this->request->get('mobile');
|
|
|
|
|
if ($mobile) {
|
|
|
|
|
$user = User::where('mobile', $mobile)->field('id,avatar,real_name,nickname,mobile,user_ship,purchase_funds,label_id')->find();
|
|
|
|
|
if ($user) {
|
|
|
|
|
$address = UserAddress::where('uid', $user['id'])->where('is_default', 1)->find();
|
|
|
|
|
if ($address) {
|
|
|
|
|
$city_name = Db::name('geo_city')->where('city_code', $address['city'])->value('city_name');
|
|
|
|
|
$area_name = Db::name('geo_area')->where('area_code', $address['area'])->value('area_name');
|
|
|
|
|
$street_name = Db::name('geo_street')->where('street_code', $address['street'])->value('street_name');
|
|
|
|
|
$village_name = Db::name('geo_village')->where('village_code', $address['village'])->value('village_name');
|
|
|
|
|
$brigade_name = Db::name('geo_brigade')->where('id', $address['brigade'])->value('brigade_name');
|
|
|
|
|
$address['address_like'] = $city_name . $area_name . $street_name . $village_name . $brigade_name;
|
2024-06-28 15:10:23 +08:00
|
|
|
|
}
|
2024-08-05 17:47:51 +08:00
|
|
|
|
$user['ship_name'] = $user['user_ship'] > 0 ? UserShip::where('id', $user['user_ship'])->value('title') : '';
|
|
|
|
|
$user['address_info'] = $address;
|
|
|
|
|
return $this->success('ok', $user->toArray());
|
|
|
|
|
} else {
|
|
|
|
|
return $this->fail('用户不存在', [], 0, 0);
|
2024-06-28 14:26:39 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-08-05 17:47:51 +08:00
|
|
|
|
return $this->success('ok', []);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 提现信息
|
|
|
|
|
*/
|
|
|
|
|
public function cash_info()
|
|
|
|
|
{
|
2024-08-16 14:42:23 +08:00
|
|
|
|
$info = User::where('id', $this->userId)->field('id,real_name,mobile,now_money,id_card')->find();
|
2024-08-16 17:51:38 +08:00
|
|
|
|
$info['notes'] = '提现金额需大于1元,提现到微信零钱,并财务审核,审核通过后,提现金额将自动到账。若本月提现超过800元,将产生个人所得税款,具体税率及金额根据《中华人民共和国个人所得税法》第二条、第三条、第六条规定扣缴。';
|
2024-08-16 13:48:47 +08:00
|
|
|
|
$info['extract_price'] =StoreExtract::where('uid',$this->userId)->sum('extract_price');
|
2024-08-05 17:47:51 +08:00
|
|
|
|
return $this->data($info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 提交提现申请
|
|
|
|
|
*/
|
|
|
|
|
public function cash_application()
|
|
|
|
|
{
|
|
|
|
|
$money = $this->request->post('money');
|
|
|
|
|
$find = User::where('id', $this->userId)->find();
|
2024-08-14 18:00:22 +08:00
|
|
|
|
if ($find && $money > $find['now_money']) {
|
2024-08-05 17:47:51 +08:00
|
|
|
|
return $this->fail('提现金额不能大于余额');
|
|
|
|
|
}
|
|
|
|
|
if ($money < 1) {
|
|
|
|
|
return $this->fail('提现金额不能小于1元');
|
|
|
|
|
}
|
2024-08-16 14:42:23 +08:00
|
|
|
|
if ($find['id_card']=='') {
|
|
|
|
|
return $this->fail('请先完成身份认证');
|
|
|
|
|
}
|
2024-08-05 17:47:51 +08:00
|
|
|
|
$data['uid'] = $this->userId;
|
|
|
|
|
$data['create_time'] = time();
|
|
|
|
|
$data['status'] = 0;
|
2024-08-14 18:00:22 +08:00
|
|
|
|
$data['extract_price'] = $money;
|
|
|
|
|
$data['balance'] = bcsub($find['now_money'], $money, 2);
|
|
|
|
|
$data['before_balance'] = $find['now_money'];
|
2024-08-05 17:47:51 +08:00
|
|
|
|
$data['extract_type'] = 'wx';
|
2024-08-14 18:00:22 +08:00
|
|
|
|
Db::startTrans();
|
|
|
|
|
try {
|
|
|
|
|
$res = StoreExtract::create($data);
|
|
|
|
|
$capitalFlowDao = new CapitalFlowLogic($find);
|
|
|
|
|
$capitalFlowDao->userExpense('user_withdrawal', 'withdrawal', $res['id'], $money);
|
2024-08-05 17:47:51 +08:00
|
|
|
|
User::where('id', $this->userId)->dec('now_money', $money)->update();
|
2024-08-14 22:05:33 +08:00
|
|
|
|
Db::commit();
|
2024-08-05 17:47:51 +08:00
|
|
|
|
return $this->success('申请成功,等待审核');
|
2024-08-14 22:05:33 +08:00
|
|
|
|
} catch (\Throwable $e) {
|
2024-08-14 18:00:22 +08:00
|
|
|
|
Db::rollback();
|
2024-08-05 17:47:51 +08:00
|
|
|
|
return $this->success('申请失败');
|
|
|
|
|
}
|
2024-06-28 14:26:39 +08:00
|
|
|
|
}
|
2024-06-21 11:23:08 +08:00
|
|
|
|
|
2024-08-05 17:47:51 +08:00
|
|
|
|
/**
|
|
|
|
|
* 提现申请记录
|
|
|
|
|
*/
|
|
|
|
|
public function cash_record()
|
|
|
|
|
{
|
|
|
|
|
$list = StoreExtract::where('uid', $this->userId)->order('id desc')
|
2024-08-14 18:00:22 +08:00
|
|
|
|
->field('id,extract_price price,status,pay_status,create_time')
|
|
|
|
|
->select()->each(function ($item) {
|
|
|
|
|
if ($item->status == -1) {
|
|
|
|
|
$item->status_name = '未通过';
|
|
|
|
|
} elseif ($item->status == 0) {
|
|
|
|
|
$item->status_name = '审核中';
|
|
|
|
|
} elseif ($item->status == 1) {
|
|
|
|
|
$item->status_name = '已通过';
|
|
|
|
|
}
|
|
|
|
|
$item->title = '申请提现' . $item->price . '元';
|
|
|
|
|
$item->pay_status_name = $item->status == 1 ? '已打款' : '未打款';
|
|
|
|
|
})->toArray();
|
2024-08-05 17:47:51 +08:00
|
|
|
|
return $this->data($list);
|
|
|
|
|
}
|
2024-08-16 13:48:47 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 更新身份证号
|
|
|
|
|
*/
|
|
|
|
|
public function update_id_card(){
|
2024-08-16 14:42:23 +08:00
|
|
|
|
$data= (new UserValidate())->post()->goCheck('card');
|
|
|
|
|
if($data){
|
|
|
|
|
User::where('id',$this->userId)->update(['id_card'=>$data['id_card'],'real_name'=>$data['real_name'],'nickname'=>$data['real_name']]);
|
2024-08-16 13:48:47 +08:00
|
|
|
|
return $this->success('设置成功');
|
|
|
|
|
}
|
|
|
|
|
return $this->fail('请输入身份证号');
|
|
|
|
|
}
|
2024-06-04 16:51:26 +08:00
|
|
|
|
}
|