|
|
|
@ -153,11 +153,12 @@ class Goods extends GoodsModel |
|
|
|
|
$userId = UserService::getCurrentLoginUserId(); |
|
|
|
|
$model = new GoodsBrowseLog; |
|
|
|
|
$end_time = date('Y-m-d'); |
|
|
|
|
$start_time = date('Y-m-d', strtotime($end_time . ' - 3 days')); |
|
|
|
|
$start_time = date('Y-m-d', strtotime($end_time . ' - 2 days')); |
|
|
|
|
$list = $model->with(['sku', 'goods']) |
|
|
|
|
->withoutField(['content']) |
|
|
|
|
->where('ctime', '>=', $start_time) |
|
|
|
|
->where('ctime', '<=', $end_time) |
|
|
|
|
->order('ctime', 'desc') |
|
|
|
|
->where(['user_id' => $userId]) |
|
|
|
|
->select(); |
|
|
|
|
$data = []; |
|
|
|
@ -168,7 +169,7 @@ class Goods extends GoodsModel |
|
|
|
|
$data[$value['ctime']]['week'] = $array[date("w", strtotime($value['ctime']))]; |
|
|
|
|
$data[$value['ctime']]['list'][] = [ |
|
|
|
|
'goods' => $value['goods'], |
|
|
|
|
'sku_list' => $value['sku'], |
|
|
|
|
'sku' => $value['sku'][0], |
|
|
|
|
'log_id' => $value['id'], |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|