|
...
|
...
|
@@ -9,6 +9,7 @@ |
|
|
|
|
|
|
|
namespace App\Console\Commands\DayCount;
|
|
|
|
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\Visit\Visit;
|
|
|
|
use App\Services\ProjectServer;
|
|
|
|
use Illuminate\Console\Command;
|
|
...
|
...
|
@@ -47,6 +48,8 @@ class UpgradeProjectCount extends Command |
|
|
|
public function count(){
|
|
|
|
$list = DB::connection('custom_mysql')->table('gl_customer_visit')->select('updated_date')
|
|
|
|
->groupBy('updated_date')->get()->toArray();
|
|
|
|
$project = new Project();
|
|
|
|
$projectInfo = $project->read(['id'=>439]);
|
|
|
|
if(!empty($list)){
|
|
|
|
$arr = [];
|
|
|
|
foreach ($list as $k=>$v){
|
|
...
|
...
|
@@ -58,6 +61,10 @@ class UpgradeProjectCount extends Command |
|
|
|
$arr['pv_num'] = $this->pv_num($v['updated_date']);
|
|
|
|
$arr['ip_num'] = $this->ip_num($v['updated_date']);
|
|
|
|
$arr['inquiry_num'] = $this->inquiry_num($v['updated_date']);
|
|
|
|
//服务达标天数
|
|
|
|
$arr['compliance_day'] = $projectInfo['finish_remain_day'];
|
|
|
|
//剩余服务时常
|
|
|
|
$arr['service_day'] = $projectInfo['remain_day'];
|
|
|
|
$arr['country'] = '{"也门": 4, "印度": 3, "埃及": 4, "巴西": 1, "约旦": 2, "美国": 3, "伊拉克": 4, "利比亚": 2, "墨西哥": 5, "摩洛哥": 8, "新加坡": 1, "突尼斯": 3, "巴勒斯坦": 2, "巴基斯坦": 1, "罗马尼亚": 1, "非洲地区": 2, "马来西亚": 5, "印度尼西亚": 2, "沙特阿拉伯": 3, "阿尔及利亚": 2}';
|
|
|
|
echo date('Y-m-d H:i:s') . '数据:'.json_encode($arr) . PHP_EOL;
|
|
|
|
//查询当天数据是否存在 存在则更新
|
...
|
...
|
|