|
|
|
@ -154,8 +154,7 @@ class Goods extends GoodsModel |
|
|
|
|
$model = new GoodsBrowseLog; |
|
|
|
|
$end_time = date('Y-m-d'); |
|
|
|
|
$start_time = date('Y-m-d', strtotime($end_time . ' - 2 days')); |
|
|
|
|
$list = $model->with(['sku', 'goods']) |
|
|
|
|
->withoutField(['content']) |
|
|
|
|
$list = $model->with(['sku', 'goods', 'images.file']) |
|
|
|
|
->where('ctime', '>=', $start_time) |
|
|
|
|
->where('ctime', '<=', $end_time) |
|
|
|
|
->order('ctime', 'desc') |
|
|
|
@ -167,11 +166,7 @@ class Goods extends GoodsModel |
|
|
|
|
foreach ($list as $value) { |
|
|
|
|
$data[$value['ctime']]['name'] = date('m-d', strtotime($value['ctime'])); |
|
|
|
|
$data[$value['ctime']]['week'] = $array[date("w", strtotime($value['ctime']))]; |
|
|
|
|
$data[$value['ctime']]['list'][] = [ |
|
|
|
|
'goods' => $value['goods'], |
|
|
|
|
'sku' => $value['sku'][0], |
|
|
|
|
'log_id' => $value['id'], |
|
|
|
|
]; |
|
|
|
|
$data[$value['ctime']]['list'][] = $value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return array_values($data); |
|
|
|
|