feat: 增加充值功能和优化微信发货逻辑
This commit is contained in:
parent
851349981a
commit
f6444a5b86
@ -150,6 +150,9 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
// self::afterPay($order,$extra['transaction_id']);
|
// self::afterPay($order,$extra['transaction_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值
|
||||||
|
*/
|
||||||
public static function recharge($orderSn, $extra = [])
|
public static function recharge($orderSn, $extra = [])
|
||||||
{
|
{
|
||||||
$order = UserRecharge::where('order_id', $orderSn)->findOrEmpty();
|
$order = UserRecharge::where('order_id', $orderSn)->findOrEmpty();
|
||||||
@ -177,6 +180,9 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
|
|
||||||
//更新等级
|
//更新等级
|
||||||
self::dealLevel($uid, $user->total_recharge_amount);
|
self::dealLevel($uid, $user->total_recharge_amount);
|
||||||
|
if (!empty($extra['payer']['openid']) ) {
|
||||||
|
Redis::send('push-delivery', ['order_id' => $order['order_id'], 'openid' => $extra['payer']['openid'],'logistics_type'=>3], 5);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ class WeChatMnpService
|
|||||||
/**
|
/**
|
||||||
* @notes 发货
|
* @notes 发货
|
||||||
*/
|
*/
|
||||||
public function delivery($order_id,$openid)
|
public function delivery($order_id,$openid,$logistics_type=3)
|
||||||
{
|
{
|
||||||
$token=Cache::get('mmp_access_token');
|
$token=Cache::get('mmp_access_token');
|
||||||
if(!$token){
|
if(!$token){
|
||||||
@ -114,7 +114,7 @@ class WeChatMnpService
|
|||||||
'out_trade_no'=>$order_id,
|
'out_trade_no'=>$order_id,
|
||||||
'mchid'=>config('payment.wechat.default.mch_id')
|
'mchid'=>config('payment.wechat.default.mch_id')
|
||||||
],
|
],
|
||||||
'logistics_type'=>2,
|
'logistics_type'=>$logistics_type,//1、快递物流 2、同城配送 3、虚拟商品,例如话费充值,点卡等4、用户自提
|
||||||
'delivery_mode'=>'UNIFIED_DELIVERY',
|
'delivery_mode'=>'UNIFIED_DELIVERY',
|
||||||
'shipping_list'=>[
|
'shipping_list'=>[
|
||||||
['item_desc'=>'商品']
|
['item_desc'=>'商品']
|
||||||
|
@ -19,7 +19,7 @@ class PushDeliverySend implements Consumer
|
|||||||
// 消费
|
// 消费
|
||||||
public function consume($data)
|
public function consume($data)
|
||||||
{
|
{
|
||||||
(new WeChatMnpService)->delivery($data['order_id'], $data['openid']);
|
(new WeChatMnpService)->delivery($data['order_id'], $data['openid'],$data['logistics_type']??3);
|
||||||
|
|
||||||
}
|
}
|
||||||
public function onConsumeFailure(\Throwable $e, $package)
|
public function onConsumeFailure(\Throwable $e, $package)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace app\queue\redis;
|
namespace app\queue\redis;
|
||||||
|
|
||||||
use app\admin\logic\operation\OpurchaseclassLogic;
|
use app\admin\logic\operation\OpurchaseclassLogic;
|
||||||
|
use app\common\enum\PayEnum;
|
||||||
use app\common\model\goods\Goods;
|
use app\common\model\goods\Goods;
|
||||||
use app\common\model\goods\Unit;
|
use app\common\model\goods\Unit;
|
||||||
use app\common\model\merchant\Merchant;
|
use app\common\model\merchant\Merchant;
|
||||||
@ -46,6 +47,7 @@ class PushPlatformPrintSend implements Consumer
|
|||||||
$mer_user_info = SystemStoreStaff::where('store_id', $find['store_id'])->where('is_admin',1)->field('staff_name,phone')->find();
|
$mer_user_info = SystemStoreStaff::where('store_id', $find['store_id'])->where('is_admin',1)->field('staff_name,phone')->find();
|
||||||
$user = User::where('id', $find['uid'])->field('nickname,mobile')->find();
|
$user = User::where('id', $find['uid'])->field('nickname,mobile')->find();
|
||||||
$find['system_store_name'] = $merchant['name'];
|
$find['system_store_name'] = $merchant['name'];
|
||||||
|
$find['pay_type_name'] = PayEnum::getPaySceneDesc($find['pay_type']);
|
||||||
$find['system_store_phone'] = $merchant['phone'];
|
$find['system_store_phone'] = $merchant['phone'];
|
||||||
$find['staff_name'] = $mer_user_info['staff_name'];
|
$find['staff_name'] = $mer_user_info['staff_name'];
|
||||||
$find['staff_phone'] = $mer_user_info['phone'];
|
$find['staff_phone'] = $mer_user_info['phone'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user