作者 lyh

gx

@@ -37,9 +37,9 @@ class InquiryMonthlyCount extends Command @@ -37,9 +37,9 @@ class InquiryMonthlyCount extends Command
37 $deployModel = new DeployBuild(); 37 $deployModel = new DeployBuild();
38 $list = $deployModel->list(); 38 $list = $deployModel->list();
39 // 获取上个月的开始时间 39 // 获取上个月的开始时间
40 - $startTime = Carbon::now()->subMonth()->startOfMonth(); 40 + $startTime = Carbon::now()->subMonth()->startOfMonth()->toDateString();
41 // 获取上个月的结束时间 41 // 获取上个月的结束时间
42 - $endTime = Carbon::now()->subMonth()->endOfMonth(); 42 + $endTime = Carbon::now()->subMonth()->endOfMonth()->toDateString();
43 foreach ($list as $value){ 43 foreach ($list as $value){
44 //按月统计询盘记录 44 //按月统计询盘记录
45 $this->inquiryCount($startTime,$endTime,$value['test_domain'],$value['project_id']); 45 $this->inquiryCount($startTime,$endTime,$value['test_domain'],$value['project_id']);
@@ -148,7 +148,7 @@ class ComController extends BaseController @@ -148,7 +148,7 @@ class ComController extends BaseController
148 148
149 public function ceshi(){ 149 public function ceshi(){
150 150
151 - $startTime = Carbon::now()->subMonth()->startOfMonth(); 151 + $startTime = Carbon::now()->subMonth(1)->startOfMonth();
152 // 获取上个月的结束时间 152 // 获取上个月的结束时间
153 $endTime = Carbon::now()->subMonth(1)->endOfMonth(); 153 $endTime = Carbon::now()->subMonth(1)->endOfMonth();
154 $pv = DB::table('gl_count') 154 $pv = DB::table('gl_count')
@@ -156,7 +156,7 @@ class ComController extends BaseController @@ -156,7 +156,7 @@ class ComController extends BaseController
156 ->where('date','>=',$startTime->toDateString().' 00:00:00') 156 ->where('date','>=',$startTime->toDateString().' 00:00:00')
157 ->where('date','<=',$endTime->toDateString().' 23:59:59') 157 ->where('date','<=',$endTime->toDateString().' 23:59:59')
158 ->sum('pv_num'); 158 ->sum('pv_num');
159 - $this->response('success',Code::SUCCESS,$endTime); 159 + $this->response('success',Code::SUCCESS,$pv);
160 } 160 }
161 161
162 /** 162 /**