|
...
|
...
|
@@ -3,7 +3,10 @@ |
|
|
|
namespace App\Http\Controllers\Bside\HomeCount;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Helper\Common;
|
|
|
|
use App\Http\Controllers\Bside\BaseController;
|
|
|
|
use App\Models\Project\DeployBuild;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
|
|
class CountController extends BaseController
|
|
|
|
{
|
|
...
|
...
|
@@ -22,5 +25,28 @@ class CountController extends BaseController |
|
|
|
return $this->response('success',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
* @name :(手动获取昨日数据统计)yesterday
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/5/24 9:13
|
|
|
|
*/
|
|
|
|
public function yesterday(){
|
|
|
|
$deployModel = new DeployBuild();
|
|
|
|
$list = $deployModel->list();
|
|
|
|
$data = [];
|
|
|
|
foreach ($list as $v){
|
|
|
|
$arr = [];
|
|
|
|
$yesterday = now()->subDay();
|
|
|
|
$arr['yesterday_pv_num'] = DB::table('gl_customer_visit_item')->whereDate('created_at', $yesterday)->where('domain',$v['test_domain'])->count();
|
|
|
|
$arr['yesterday_ip_num'] = DB::table('gl_customer_visit')->whereDate('created_at', $yesterday)->where('domain',$v['test_domain'])->count();
|
|
|
|
$arr['inquiry_num'] = DB::table('gl_inquiry_set')->whereDate('created_at', $yesterday)->where('project_id',$v['project_id'])->count();
|
|
|
|
$arr['date'] = date('Y-m-d',time());
|
|
|
|
$arr['compliance_day'] = DB::table('gl_rank_data')->where(['updated_date'=>$yesterday,'lang'=>null])->select(['compliance_day'])->first()['compliance_day'];
|
|
|
|
$arr['service_day'] = $v['service_duration'] - Common::getDaysToTargetDate($v['created_at']);
|
|
|
|
$data[] = $arr;
|
|
|
|
}
|
|
|
|
DB::table('gl_yesterday_count')->insert($data);
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|