|
|
|
@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
namespace App\Service; |
|
|
|
|
|
|
|
use App\Model\OrderMain; |
|
|
|
use Hyperf\Di\Annotation\Inject; |
|
|
|
use Hyperf\DbConnection\Db; |
|
|
|
use App\Model\CouponUserRecType; |
|
|
|
@ -284,7 +285,11 @@ class CouponService implements CouponServiceInterface |
|
|
|
* @param $order_id |
|
|
|
* @return bool |
|
|
|
*/ |
|
|
|
public function refundOrderCoupons($order_id){ |
|
|
|
public function refundOrderCoupons($global_order_id){ |
|
|
|
$order_main = OrderMain::where('global_order_id',$global_order_id) |
|
|
|
->select('id','user_id') |
|
|
|
->first(); |
|
|
|
$order_id = $order_main->id; |
|
|
|
$coupon = CouponUserUse::where([ |
|
|
|
['order_main_id','=',$order_id], |
|
|
|
['status','=',CouponUserUse::COUPON_USE_STATE_USED], |
|
|
|
@ -312,9 +317,6 @@ class CouponService implements CouponServiceInterface |
|
|
|
]); |
|
|
|
|
|
|
|
//删除当日 redis 使用记录缓存
|
|
|
|
$order_main = OrderMain::where('id',$order_id) |
|
|
|
->select('global_order_id','user_id') |
|
|
|
->first(); |
|
|
|
$redis = ApplicationContext::getContainer()->get(Redis::class); |
|
|
|
$remRes = $redis->sRem( |
|
|
|
'coupon_'.date('Ymd').'_used_'.$order_main->user_id, |
|
|
|
|