非当月退货的不退货
This commit is contained in:
parent
d1eadd331e
commit
e561f8f4d2
@ -35,11 +35,13 @@ class RefundSync extends Command
|
||||
$simArray = array_merge($simArray, $item->sim);
|
||||
});
|
||||
|
||||
DB::transaction(function () use ($refunds) {
|
||||
// 最早退货的时间
|
||||
DB::transaction(function () use ($refunds, $starttime) {
|
||||
foreach ($refunds as $item) {
|
||||
DB::table('real_order_cards')
|
||||
->whereIn('sim', $item->sim)
|
||||
->where('created_at', '<=', $item->create_time)
|
||||
->where('created_at', '>=', $starttime)
|
||||
->update(['refunded_at' => $item->create_time]);
|
||||
|
||||
$simArrayText = implode(',', $item->sim);
|
||||
@ -51,9 +53,10 @@ class RefundSync extends Command
|
||||
WHERE c.sim = v.sim
|
||||
AND v.sim IN (%s)
|
||||
AND v.created_at <= '%s'
|
||||
AND v.created_at >= '%s'
|
||||
";
|
||||
|
||||
DB::update(sprintf($sql, $item->create_time, $simArrayText, $item->create_time));
|
||||
DB::update(sprintf($sql, $item->create_time, $simArrayText, $item->create_time, $starttime));
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user