Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
2 个修改的文件
包含
25 行增加
和
2 行删除
| @@ -13,6 +13,7 @@ use App\Models\Geo\GeoQuestionLog; | @@ -13,6 +13,7 @@ use App\Models\Geo\GeoQuestionLog; | ||
| 13 | use App\Models\Geo\GeoQuestionResult; | 13 | use App\Models\Geo\GeoQuestionResult; |
| 14 | use Illuminate\Console\Command; | 14 | use Illuminate\Console\Command; |
| 15 | use Illuminate\Support\Carbon; | 15 | use Illuminate\Support\Carbon; |
| 16 | +use App\Models\Geo\GeoCount as GeoCountModel; | ||
| 16 | 17 | ||
| 17 | class GeoCount extends Command | 18 | class GeoCount extends Command |
| 18 | { | 19 | { |
| @@ -50,6 +51,7 @@ class GeoCount extends Command | @@ -50,6 +51,7 @@ class GeoCount extends Command | ||
| 50 | */ | 51 | */ |
| 51 | public function _action() | 52 | public function _action() |
| 52 | { | 53 | { |
| 54 | + $geoCountModel = new GeoCountModel(); | ||
| 53 | //获取前一天的项目id | 55 | //获取前一天的项目id |
| 54 | $date = Carbon::yesterday()->format('Y-m-d'); | 56 | $date = Carbon::yesterday()->format('Y-m-d'); |
| 55 | $start = $date.' 00:00:00'; | 57 | $start = $date.' 00:00:00'; |
| @@ -73,10 +75,14 @@ class GeoCount extends Command | @@ -73,10 +75,14 @@ class GeoCount extends Command | ||
| 73 | 'total'=>$total,//收录总数 | 75 | 'total'=>$total,//收录总数 |
| 74 | ]; | 76 | ]; |
| 75 | foreach ($platforms as $platform){ | 77 | foreach ($platforms as $platform){ |
| 76 | - $data[$platform] = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'platform'=>$platform,'created_at' => ['between',[$start,$end]]]); | 78 | + if($item == 'openai-not-network'){ |
| 79 | + $data['openai_not_network'] = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'platform'=>$platform,'created_at' => ['between',[$start,$end]]]); | ||
| 80 | + }else{ | ||
| 81 | + $data[$platform] = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'platform'=>$platform,'created_at' => ['between',[$start,$end]]]); | ||
| 82 | + } | ||
| 77 | } | 83 | } |
| 78 | //新增一条数据 | 84 | //新增一条数据 |
| 79 | - $geoQuestionResModel->addReturnId($data); | 85 | + $geoCountModel->addReturnId($data); |
| 80 | } | 86 | } |
| 81 | return true; | 87 | return true; |
| 82 | } | 88 | } |
app/Models/Geo/GeoCount.php
0 → 100644
-
请 注册 或 登录 后发表评论