chore: 添加静态资源文件和版本配置文件
添加大量图片、字体、音频等静态资源文件,包括用户界面图片、模板文件和安装界面素材 添加系统版本配置文件(.version)和常量定义文件(.constant) 更新供应商依赖文件,包括Symfony VarDumper组件和相关许可证文件 添加验证码配置文件(captcha.php)和.gitignore规则
This commit is contained in:
92
app/services/pay/PayMchNotifyServices.php
Normal file
92
app/services/pay/PayMchNotifyServices.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\services\pay;
|
||||
|
||||
use app\jobs\system\CapitalFlowJob;
|
||||
use app\services\activity\lottery\LuckLotteryRecordServices;
|
||||
use app\services\order\OtherOrderServices;
|
||||
use app\services\order\StoreOrderSuccessServices;
|
||||
use app\services\user\UserExtractServices;
|
||||
use app\services\user\UserRechargeServices;
|
||||
use app\services\user\UserServices;
|
||||
|
||||
/**
|
||||
* 提现回调
|
||||
* Class PayNotifyServices
|
||||
* @package app\services\pay
|
||||
*/
|
||||
class PayMchNotifyServices
|
||||
{
|
||||
|
||||
/**
|
||||
* 提现
|
||||
* @param string|null $order_id 订单id
|
||||
* @return bool
|
||||
*/
|
||||
public function wechatTx(string $order_id = null, string $trade_no = null, string $state = null, string $fail_reason = null)
|
||||
{
|
||||
try {
|
||||
$services = app()->make(UserExtractServices::class);
|
||||
$userExtract = $services->getOne(['transfer_bill_no' => $trade_no]);
|
||||
if (!$userExtract) {
|
||||
return true;
|
||||
}
|
||||
$userExtract->wechat_state = $state;
|
||||
if ($fail_reason) {
|
||||
$userExtract->fail_reason = $fail_reason;
|
||||
}
|
||||
|
||||
if ($state == 'SUCCESS') {
|
||||
/** @var UserServices $userServices */
|
||||
$userServices = app()->make(UserServices::class);
|
||||
$userType = $userServices->value(['uid' => $userExtract['uid']], 'user_type');
|
||||
$nickname = $userServices->value(['uid' => $userExtract['uid']], 'nickname');
|
||||
$phone = $userServices->value(['uid' => $userExtract['uid']], 'phone');
|
||||
|
||||
//记录资金流水队列
|
||||
CapitalFlowJob::dispatch([['order_id' => $userExtract['id'], 'store_id' => 0, 'uid' => $userExtract['uid'], 'nickname' => $nickname, 'phone' => $phone, 'price' => $userExtract['extract_price'], 'pay_type' => $userExtract['extract_type']], 'extract']);
|
||||
|
||||
//消息推送
|
||||
event('notice.notice', [['uid' => $userExtract['uid'], 'userType' => strtolower($userType), 'extractNumber' => $userExtract['extract_price'], 'nickname' => $nickname], 'user_extract']);
|
||||
}else{
|
||||
app()->make(UserExtractServices::class)->changeFail($userExtract['id'], $userExtract->toArray(), '提现失败,原因:超时未领取');
|
||||
}
|
||||
$userExtract->save();
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 红包
|
||||
* @param string|null $order_id 订单id
|
||||
* @return bool
|
||||
*/
|
||||
public function wechatHb(string $order_id = null, string $trade_no = null, string $state = null, string $fail_reason = null)
|
||||
{
|
||||
try {
|
||||
$info = app()->make(LuckLotteryRecordServices::class)->get(['transfer_bill_no' => $trade_no]);
|
||||
if (!$info) {
|
||||
return true;
|
||||
}
|
||||
$info->wechat_state = $state;
|
||||
if ($fail_reason) {
|
||||
$info->fail_reason = $fail_reason;
|
||||
}
|
||||
$info->save();
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user