提现修复
This commit is contained in:
@@ -5,16 +5,16 @@
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-10-11 11:22:56
|
||||
* @LastEditors: kangkang
|
||||
* @LastEditTime: 2020-10-21 20:01:22
|
||||
* @LastEditTime: 2020-10-21 20:26:56
|
||||
*/
|
||||
|
||||
namespace app\order\controller;
|
||||
|
||||
use alipay\Alipay;
|
||||
use app\order\model\CashOut as CashMoedl;
|
||||
use app\order\model\User as UserModel;
|
||||
use app\order\model\UserScore as ScoreModel;
|
||||
use fastphp\base\Controller;
|
||||
use alipay\Alipay;
|
||||
|
||||
class CashOutAdmin extends Controller
|
||||
{
|
||||
@@ -64,8 +64,8 @@ class CashOutAdmin extends Controller
|
||||
|
||||
/**
|
||||
* @description: 处理订单
|
||||
* @param {type}
|
||||
* @return {type}
|
||||
* @param {type}
|
||||
* @return {type}
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
@@ -79,35 +79,33 @@ class CashOutAdmin extends Controller
|
||||
$user = $this->userinfo;
|
||||
$cash = new CashMoedl;
|
||||
$cash_data = $cash->getOne(['id' => $id]);
|
||||
if($data['status'] == '1'){
|
||||
|
||||
|
||||
if ($data['status'] == '1') {
|
||||
|
||||
$param = [
|
||||
'out_biz_no'=>'2020'.time().rand(10000,99999),
|
||||
$param = [
|
||||
'out_biz_no' => '2020' . time() . rand(10000, 99999),
|
||||
'trans_amount' => $cash_data['money'],
|
||||
'product_code' => 'TRANS_ACCOUNT_NO_PWD',
|
||||
'biz_scene' => 'DIRECT_TRANSFER',
|
||||
'payee_info' => [
|
||||
'identity' => $cash_data['alipay_account'],
|
||||
'identity_type' => 'ALIPAY_LOGON_ID',
|
||||
'name' => $cash_data['real_name']
|
||||
'name' => $cash_data['real_name'],
|
||||
],
|
||||
'remark' => '聚IP提现-会员'.$cash_data['username'].'-'.$cash_data['money'].'元'
|
||||
'remark' => '聚IP提现-会员' . $cash_data['username'] . '-' . $cash_data['money'] . '元',
|
||||
];
|
||||
$result = Alipay::transfer($param);
|
||||
if ($result){
|
||||
if ($result) {
|
||||
$data['cash_no'] = $result->alipay_fund_trans_uni_transfer_response->out_biz_no;
|
||||
$data['alipay_no'] = $result->alipay_fund_trans_uni_transfer_response->order_id;
|
||||
$data['status'] = 1;
|
||||
} else {
|
||||
die;
|
||||
}
|
||||
} else if($data['status'] == '2'){
|
||||
} else if ($data['status'] == '2') {
|
||||
$user_model = new UserModel;
|
||||
$user_rest = $user_model->getOne(['id'=>$data['userid']],'RestAmount')['RestAmount'];
|
||||
$user_rest = $user_model->getOne(['id' => $data['userid']], 'RestAmount')['RestAmount'];
|
||||
$rest = $user_rest + $cash_data['money'];
|
||||
$user_model->where(['id'=>$data['userid']])->update(['RestAmount'=>$rest]);
|
||||
$user_model->where(['id' => $data['userid']])->update(['RestAmount' => $rest]);
|
||||
$score = new ScoreModel;
|
||||
$score_data = [
|
||||
'UserId' => $data['userid'],
|
||||
@@ -118,8 +116,8 @@ class CashOutAdmin extends Controller
|
||||
'OperateUserName' => $user['LoginName'],
|
||||
'RestAmount1' => $user_rest,
|
||||
'RestAmount2' => $rest,
|
||||
'CreateTime' => date('Y-m-d H:i:s',time()),
|
||||
'UpdateTime' => date('Y-m-d H:i:s',time()),
|
||||
'CreateTime' => date('Y-m-d H:i:s', time()),
|
||||
'UpdateTime' => date('Y-m-d H:i:s', time()),
|
||||
'TenantId' => 0,
|
||||
'DeleteTag' => 0,
|
||||
];
|
||||
@@ -130,7 +128,7 @@ class CashOutAdmin extends Controller
|
||||
if (!in_array($data['status'], $status)) {
|
||||
unset($data['status']);
|
||||
}
|
||||
|
||||
|
||||
$up_status = $cash->where(['id' => $id])->update($data);
|
||||
$return_info = [
|
||||
'Code' => 10000,
|
||||
|
||||
Reference in New Issue
Block a user