活动开启下单后更新用户的等级

This commit is contained in:
liu 2024-06-06 17:04:34 +08:00
parent f5da7a4359
commit 2627df98eb
2 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,41 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\enum\user;
/**
* 管理后台登录终端
* Class terminalEnum
* @package app\common\enum
*/
class UserShipEnum
{
/**
* 性别
* LEVEL_ONE = 优享会员
* LEVEL_TWO = 泸优精英
* LEVEL_THREE = 泸优达人
* LEVEL_FOUR = 泸优荣耀
* LEVEL_FIVE = 泸优权威
*/
const LEVEL_ONE = 1;
const LEVEL_TWO = 7;
const LEVEL_THREE = 8;
const LEVEL_FOUR = 9;
const LEVEL_FIVE = 10;
}

View File

@ -4,6 +4,8 @@ namespace app\common\logic;
use app\common\enum\OrderEnum; use app\common\enum\OrderEnum;
use app\common\enum\PayEnum; use app\common\enum\PayEnum;
use app\common\enum\user\UserShipEnum;
use app\common\model\dict\DictType;
use app\common\model\pay\PayNotify; use app\common\model\pay\PayNotify;
use app\common\model\store_finance_flow\StoreFinanceFlow; use app\common\model\store_finance_flow\StoreFinanceFlow;
use app\common\model\store_order\StoreOrder; use app\common\model\store_order\StoreOrder;
@ -98,6 +100,12 @@ class PayNotifyLogic extends BaseLogic
$capitalFlowDao->userExpense('user_order_pay', 'order', $order['id'], $order->pay_price,'',1); $capitalFlowDao->userExpense('user_order_pay', 'order', $order['id'], $order->pay_price,'',1);
self::afterPay($order,$extra['transaction_id']); self::afterPay($order,$extra['transaction_id']);
//活动期间消费
$check = DictType::where('type','activities')->find();
if(isset($check) && $check['status'] == 1 && $user['user_ship'] == 0){
self::dealChange($order['uid']);
}
if ($order->pay_type == 9) { if ($order->pay_type == 9) {
$extra['create_time'] = $order['create_time']; $extra['create_time'] = $order['create_time'];
PushService::push('store_merchant_' . $order['id'], $order['id'], ['type' => 'cash_register', 'msg' => '您有一笔订单已支付', 'data' => $extra]); PushService::push('store_merchant_' . $order['id'], $order['id'], ['type' => 'cash_register', 'msg' => '您有一笔订单已支付', 'data' => $extra]);
@ -235,6 +243,13 @@ class PayNotifyLogic extends BaseLogic
} }
//处理活动期间直接改用户的等级
public static function dealChange($uid)
{
User::where('id',$uid)->update(['user_ship'=>UserShipEnum::LEVEL_ONE]);
return true;
}
/** /**
* 回调日志 * 回调日志