Commit cffeceaa by 朱继来

调整报价统计

parent afcbe111
Showing with 5 additions and 5 deletions
...@@ -530,7 +530,7 @@ class QuoteModel extends Model ...@@ -530,7 +530,7 @@ class QuoteModel extends Model
$start_time = $curr_zero_time + $i * 3600; $start_time = $curr_zero_time + $i * 3600;
$end_time = $start_time + 3600; $end_time = $start_time + 3600;
$data['today_quote'][] = $this->getTodayQoutCount($input, $start_time); $data['today_quote'][] = $this->getTodayQoutCount($input, $start_time, $end_time);
$data['today_no_quote'][] = $this->getTodayNoQoutCount($input, $start_time, $end_time); $data['today_no_quote'][] = $this->getTodayNoQoutCount($input, $start_time, $end_time);
$data['x_axis_data'][] = $i.'点'; $data['x_axis_data'][] = $i.'点';
} }
...@@ -541,7 +541,7 @@ class QuoteModel extends Model ...@@ -541,7 +541,7 @@ class QuoteModel extends Model
$start_time = $curr_zero_time - $i * 86400; $start_time = $curr_zero_time - $i * 86400;
$end_time = $start_time + 86399; $end_time = $start_time + 86399;
$data['today_quote'][] = $this->getTodayQoutCount($input, $start_time); $data['today_quote'][] = $this->getTodayQoutCount($input, $start_time, $end_time);
$data['today_no_quote'][] = $this->getTodayNoQoutCount($input, $start_time, $end_time); $data['today_no_quote'][] = $this->getTodayNoQoutCount($input, $start_time, $end_time);
$data['x_axis_data'][] = date('Y-m-d', $curr_zero_time - $i * 86400); $data['x_axis_data'][] = date('Y-m-d', $curr_zero_time - $i * 86400);
} }
...@@ -552,7 +552,7 @@ class QuoteModel extends Model ...@@ -552,7 +552,7 @@ class QuoteModel extends Model
$start_time = $curr_zero_time - $i * 86400; $start_time = $curr_zero_time - $i * 86400;
$end_time = $start_time + 86399; $end_time = $start_time + 86399;
$data['today_quote'][] = $this->getTodayQoutCount($input, $start_time); $data['today_quote'][] = $this->getTodayQoutCount($input, $start_time, $end_time);
$data['today_no_quote'][] = $this->getTodayNoQoutCount($input, $start_time, $end_time); $data['today_no_quote'][] = $this->getTodayNoQoutCount($input, $start_time, $end_time);
$data['x_axis_data'][] = date('Y-m-d', $curr_zero_time - $i * 86400); $data['x_axis_data'][] = date('Y-m-d', $curr_zero_time - $i * 86400);
} }
...@@ -564,9 +564,9 @@ class QuoteModel extends Model ...@@ -564,9 +564,9 @@ class QuoteModel extends Model
} }
// 当日报价数 // 当日报价数
public function getTodayQoutCount($input, $start_time) public function getTodayQoutCount($input, $start_time, $end_time)
{ {
return $this->where('create_uid', $input['user_id'])->where('create_time', '>=', $start_time)->count(); return $this->where('create_uid', $input['user_id'])->whereBetween('create_time', [$start_time, $end_time])->count();
} }
// 当日未报价数 // 当日未报价数
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment