门店商品统计修改统计逻辑
This commit is contained in:
parent
304f5fddce
commit
aafe828da7
@ -102,9 +102,21 @@ class WorkbenchController extends BaseAdminController
|
|||||||
// ]
|
// ]
|
||||||
public function get_basic(\app\admin\controller\WorkbenchController $workbench)
|
public function get_basic(\app\admin\controller\WorkbenchController $workbench)
|
||||||
{
|
{
|
||||||
$params = $this->request->get();
|
$dateRange = $this->request->get('date');
|
||||||
$params['store_id'] = $this->request->adminInfo['store_id'];
|
// 拆分日期范围
|
||||||
return $workbench->get_basic();
|
list($startDate, $endDate) = explode('-', $dateRange);
|
||||||
|
$startTime = str_replace('/', '-', $startDate);
|
||||||
|
$endTime = str_replace('/', '-', $endDate);
|
||||||
|
if (empty($startTime)) { //如果没有传开始时间,则默认获取最近7天的数据
|
||||||
|
$startTime = strtotime(date('Y-m-d'));
|
||||||
|
$endTime = $startTime + 86400;
|
||||||
|
}
|
||||||
|
$where = [
|
||||||
|
['create_time', 'between', [$startTime, $endTime]],
|
||||||
|
['store_id','=',$this->request->adminInfo['store_id']]
|
||||||
|
];
|
||||||
|
$data = \app\admin\logic\WorkbenchLogic::get_basic($where);
|
||||||
|
return $this->data($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// #[
|
// #[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user