合并分支 'lyh-server' 到 'master'
变更数据 查看合并请求 !2949
正在显示
2 个修改的文件
包含
20 行增加
和
1 行删除
| @@ -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'; |
| @@ -76,7 +78,7 @@ class GeoCount extends Command | @@ -76,7 +78,7 @@ class GeoCount extends Command | ||
| 76 | $data[$platform] = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'platform'=>$platform,'created_at' => ['between',[$start,$end]]]); | 78 | $data[$platform] = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'platform'=>$platform,'created_at' => ['between',[$start,$end]]]); |
| 77 | } | 79 | } |
| 78 | //新增一条数据 | 80 | //新增一条数据 |
| 79 | - $geoQuestionResModel->addReturnId($data); | 81 | + $geoCountModel->addReturnId($data); |
| 80 | } | 82 | } |
| 81 | return true; | 83 | return true; |
| 82 | } | 84 | } |
app/Models/Geo/GeoCount.php
0 → 100644
-
请 注册 或 登录 后发表评论