feat: #10000 日志查询修改

This commit is contained in:
赵世界 2022-08-23 17:49:18 +08:00
parent 1efd29cb0f
commit ad9f0af8b5
2 changed files with 4 additions and 4 deletions

View File

@ -40,10 +40,10 @@ class GoodsSkusExport implements FromCollection, ShouldAutoSize
'库存',
];
$inventoryTime = strtotime(date('Y-m-d 07:00:00'));
$ids = Log::query()->where('target_type', 'sku')
$ids = Log::query()->where('target_type', 'goods_sku')
->where('target_field', $this->type)
->where('created_at', '>', $inventoryTime)
->pluck('sku_id')
->pluck('target_id')
->toArray();
$data = GoodsSku::query()
->when($ids, function ($query, $ids) {

View File

@ -42,10 +42,10 @@ class GoodsSkusController extends Controller
// 状态变更时间查询,日志
$ids = [];
if ($request->get('keyword_type', '') && $request->get('keyword_value', '')) {
$ids = Log::query()->where('target_type', 'sku')
$ids = Log::query()->where('target_type', 'goods_sku')
->where('target_field', $request->keyword_type)
->whereBetween('created_at', explode(' - ', $request->keyword_value))
->pluck('sku_id')
->pluck('target_id')
->toArray();
}
$day = DateTimeUtils::getToday();