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