|
...
|
...
|
@@ -289,7 +289,7 @@ class AdsController extends BaseController |
|
|
|
*/
|
|
|
|
public function fbInquiryChart(Request $request)
|
|
|
|
{
|
|
|
|
$start_date = $request->input('start_date', date('Y-m-d', strtotime('-1 month')));
|
|
|
|
$start_date = $request->input('start_date', date('Y-m-d', strtotime('-3 month')));
|
|
|
|
$end_date = $request->input('end_date', date('Y-m-d'));
|
|
|
|
$result = ReInquiryForm::select(DB::raw('DATE(inquiry_date) as date'), DB::raw('COUNT(*) as count'))
|
|
|
|
->whereBetween('inquiry_date', [$start_date, date('Y-m-d', strtotime($end_date . ' +1 day'))])
|
|
...
|
...
|
@@ -297,7 +297,7 @@ class AdsController extends BaseController |
|
|
|
->pluck('count', 'date')->toArray();
|
|
|
|
$data = [];
|
|
|
|
while ($start_date <= $end_date) {
|
|
|
|
$data[$start_date] = $result[$start_date]??0;
|
|
|
|
$data[$start_date] = ($result[$start_date]??0) * 3 ;
|
|
|
|
$start_date = date('Y-m-d', strtotime($start_date . ' + 1 day'));
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|