feat(OrderLogic, UserLogic, PayNotifyLogic, PushDeliverySend): 修改订单与用户逻辑,支持新支付方式与库存计算,优化小程序通知
This commit is contained in:
parent
1ea3a0ab14
commit
cf118c81ff
@ -210,8 +210,8 @@ class OrderLogic extends BaseLogic
|
||||
$_order['user_phone'] = $address['phone'];
|
||||
$_order['user_address'] = $address['detail'];
|
||||
}
|
||||
} else {
|
||||
//没有地址时,默认为门店自提
|
||||
}
|
||||
if($params['shipping_type'] == 2){
|
||||
$_order['status'] = 1;
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ class UserLogic extends BaseLogic
|
||||
public static function info($uid)
|
||||
{
|
||||
$data = User::with(['userShip'])->where('id',$uid)
|
||||
->field('avatar,real_name,nickname,account,mobile,sex,login_ip,now_money,total_recharge_amount,user_ship')
|
||||
->field('id,avatar,real_name,nickname,account,mobile,sex,login_ip,now_money,total_recharge_amount,user_ship')
|
||||
->find();
|
||||
//判断是不是员工
|
||||
if($data){
|
||||
|
@ -126,7 +126,7 @@ class PayNotifyLogic extends BaseLogic
|
||||
Redis::send('push-platform-print', ['id' => $order['id']], 60);
|
||||
// Db::name('order_middle')->insert(['c_order_id' => $order['id']]);
|
||||
}
|
||||
if (!empty($extra['payer']['openid']) && $order->pay_type != 9) {
|
||||
if (!empty($extra['payer']['openid']) && $order->pay_type == 7) {
|
||||
Redis::send('push-delivery', ['order_sn' => $order['order_id'], 'openid' => $extra['payer']['openid']], 5);
|
||||
}
|
||||
return true;
|
||||
|
30
app/queue/redis/PushDeliverySend.php
Normal file
30
app/queue/redis/PushDeliverySend.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace app\queue\redis;
|
||||
|
||||
use app\common\service\wechat\WeChatMnpService;
|
||||
use Webman\RedisQueue\Consumer;
|
||||
|
||||
use support\Log;
|
||||
|
||||
class PushDeliverySend implements Consumer
|
||||
{
|
||||
// 要消费的队列名
|
||||
public $queue = 'push-delivery';
|
||||
|
||||
// 连接名,对应 plugin/webman/redis-queue/redis.php 里的连接`
|
||||
public $connection = 'default';
|
||||
|
||||
// 消费
|
||||
public function consume($data)
|
||||
{
|
||||
(new WeChatMnpService)->delivery($data['order_id'], $data['openid']);
|
||||
|
||||
}
|
||||
public function onConsumeFailure(\Throwable $e, $package)
|
||||
{
|
||||
$package['max_attempts']=0;
|
||||
Log::error('推送小程序发货通知失败:'.$package['data']['order_id']);
|
||||
return $package;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user