正在显示
5 个修改的文件
包含
27 行增加
和
28 行删除
| @@ -106,7 +106,7 @@ class Count extends Command | @@ -106,7 +106,7 @@ class Count extends Command | ||
| 106 | * @method :post | 106 | * @method :post |
| 107 | * @time :2023/6/14 15:40 | 107 | * @time :2023/6/14 15:40 |
| 108 | */ | 108 | */ |
| 109 | - public function pv_num($yesterday,$domain){ | 109 | + public function pv_num($yesterday){ |
| 110 | $pv = DB::connection('custom_mysql')->table('gl_customer_visit_item')->whereDate('updated_date', $yesterday)->count(); | 110 | $pv = DB::connection('custom_mysql')->table('gl_customer_visit_item')->whereDate('updated_date', $yesterday)->count(); |
| 111 | return $pv; | 111 | return $pv; |
| 112 | } | 112 | } |
| @@ -117,7 +117,7 @@ class Count extends Command | @@ -117,7 +117,7 @@ class Count extends Command | ||
| 117 | * @method :post | 117 | * @method :post |
| 118 | * @time :2023/6/14 15:40 | 118 | * @time :2023/6/14 15:40 |
| 119 | */ | 119 | */ |
| 120 | - public function ip_num($yesterday,$domain){ | 120 | + public function ip_num($yesterday){ |
| 121 | $ip = DB::connection('custom_mysql')->table('gl_customer_visit')->whereDate('updated_date', $yesterday)->count(); | 121 | $ip = DB::connection('custom_mysql')->table('gl_customer_visit')->whereDate('updated_date', $yesterday)->count(); |
| 122 | return $ip; | 122 | return $ip; |
| 123 | } | 123 | } |
| @@ -107,7 +107,7 @@ class CountDate extends Command | @@ -107,7 +107,7 @@ class CountDate extends Command | ||
| 107 | * @method :post | 107 | * @method :post |
| 108 | * @time :2023/6/14 15:40 | 108 | * @time :2023/6/14 15:40 |
| 109 | */ | 109 | */ |
| 110 | - public function pv_num($yesterday,$domain){ | 110 | + public function pv_num($yesterday){ |
| 111 | $pv = DB::connection('custom_mysql')->table('gl_customer_visit_item')->whereDate('updated_date', $yesterday)->count(); | 111 | $pv = DB::connection('custom_mysql')->table('gl_customer_visit_item')->whereDate('updated_date', $yesterday)->count(); |
| 112 | return $pv; | 112 | return $pv; |
| 113 | } | 113 | } |
| @@ -118,7 +118,7 @@ class CountDate extends Command | @@ -118,7 +118,7 @@ class CountDate extends Command | ||
| 118 | * @method :post | 118 | * @method :post |
| 119 | * @time :2023/6/14 15:40 | 119 | * @time :2023/6/14 15:40 |
| 120 | */ | 120 | */ |
| 121 | - public function ip_num($yesterday,$domain){ | 121 | + public function ip_num($yesterday){ |
| 122 | $ip = DB::connection('custom_mysql')->table('gl_customer_visit')->whereDate('updated_date', $yesterday)->count(); | 122 | $ip = DB::connection('custom_mysql')->table('gl_customer_visit')->whereDate('updated_date', $yesterday)->count(); |
| 123 | return $ip; | 123 | return $ip; |
| 124 | } | 124 | } |
| @@ -16,6 +16,7 @@ use App\Models\HomeCount\MonthCount; | @@ -16,6 +16,7 @@ use App\Models\HomeCount\MonthCount; | ||
| 16 | use App\Models\Inquiry\InquiryFormData; | 16 | use App\Models\Inquiry\InquiryFormData; |
| 17 | use App\Models\Project\Project; | 17 | use App\Models\Project\Project; |
| 18 | use App\Models\Visit\Visit; | 18 | use App\Models\Visit\Visit; |
| 19 | +use App\Models\Visit\VisitItem; | ||
| 19 | use App\Services\ProjectServer; | 20 | use App\Services\ProjectServer; |
| 20 | use Illuminate\Console\Command; | 21 | use Illuminate\Console\Command; |
| 21 | use Illuminate\Support\Facades\DB; | 22 | use Illuminate\Support\Facades\DB; |
| @@ -137,14 +138,12 @@ class MonthAllCount extends Command | @@ -137,14 +138,12 @@ class MonthAllCount extends Command | ||
| 137 | * @time :2024/1/8 11:02 | 138 | * @time :2024/1/8 11:02 |
| 138 | */ | 139 | */ |
| 139 | public function pv_ip(&$arr,$start,$end,$project_id){ | 140 | public function pv_ip(&$arr,$start,$end,$project_id){ |
| 140 | - $pv_ip = DB::table('gl_count') | ||
| 141 | - ->where(['project_id'=>$project_id]) | ||
| 142 | - ->where('date','>=',$start.' 00:00:00') | ||
| 143 | - ->where('date','<=',$end.' 23:59:59') | ||
| 144 | - ->select(DB::raw('SUM(pv_num) as pv_num'), DB::raw('SUM(ip_num) as ip_num'),DB::raw('SUM(inquiry_num) as inquiry_num')) | ||
| 145 | - ->first(); | ||
| 146 | - $arr['pv'] = $pv_ip->pv_num; | ||
| 147 | - $arr['ip'] = $pv_ip->ip_num; | 141 | + $arr['pv'] = (new VisitItem()) |
| 142 | + ->where('updated_date','>=',$start.' 00:00:00') | ||
| 143 | + ->where('updated_date','<=',$end.' 23:59:59')->count(); | ||
| 144 | + $arr['ip'] = (new Visit()) | ||
| 145 | + ->where('updated_date','>=',$start.' 00:00:00') | ||
| 146 | + ->where('updated_date','<=',$end.' 23:59:59')->count(); | ||
| 148 | if($arr['ip'] != 0){ | 147 | if($arr['ip'] != 0){ |
| 149 | $arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 10,2); | 148 | $arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 10,2); |
| 150 | } | 149 | } |
| @@ -14,6 +14,8 @@ use App\Models\Com\UpdateOldInfo; | @@ -14,6 +14,8 @@ use App\Models\Com\UpdateOldInfo; | ||
| 14 | use App\Models\Domain\DomainInfo; | 14 | use App\Models\Domain\DomainInfo; |
| 15 | use App\Models\Inquiry\InquiryFormData; | 15 | use App\Models\Inquiry\InquiryFormData; |
| 16 | use App\Models\Project\Project; | 16 | use App\Models\Project\Project; |
| 17 | +use App\Models\Visit\Visit; | ||
| 18 | +use App\Models\Visit\VisitItem; | ||
| 17 | use App\Services\ProjectServer; | 19 | use App\Services\ProjectServer; |
| 18 | use Illuminate\Console\Command; | 20 | use Illuminate\Console\Command; |
| 19 | use Illuminate\Support\Facades\DB; | 21 | use Illuminate\Support\Facades\DB; |
| @@ -159,14 +161,12 @@ class MonthCount extends Command | @@ -159,14 +161,12 @@ class MonthCount extends Command | ||
| 159 | * @time :2024/1/8 11:02 | 161 | * @time :2024/1/8 11:02 |
| 160 | */ | 162 | */ |
| 161 | public function pv_ip(&$arr,$start,$end,$project_id){ | 163 | public function pv_ip(&$arr,$start,$end,$project_id){ |
| 162 | - $pv_ip = DB::table('gl_count') | ||
| 163 | - ->where(['project_id'=>$project_id]) | ||
| 164 | - ->where('date','>=',$start.' 00:00:00') | ||
| 165 | - ->where('date','<=',$end.' 23:59:59') | ||
| 166 | - ->select(DB::raw('SUM(pv_num) as pv_num'), DB::raw('SUM(ip_num) as ip_num'),DB::raw('SUM(inquiry_num) as inquiry_num')) | ||
| 167 | - ->first(); | ||
| 168 | - $arr['pv'] = $pv_ip->pv_num; | ||
| 169 | - $arr['ip'] = $pv_ip->ip_num; | 164 | + $arr['pv'] = (new VisitItem()) |
| 165 | + ->where('updated_date','>=',$start.' 00:00:00') | ||
| 166 | + ->where('updated_date','<=',$end.' 23:59:59')->count(); | ||
| 167 | + $arr['ip'] = (new Visit()) | ||
| 168 | + ->where('updated_date','>=',$start.' 00:00:00') | ||
| 169 | + ->where('updated_date','<=',$end.' 23:59:59')->count(); | ||
| 170 | if($arr['ip'] != 0){ | 170 | if($arr['ip'] != 0){ |
| 171 | $arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 10,2); | 171 | $arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 10,2); |
| 172 | } | 172 | } |
| @@ -14,6 +14,8 @@ use App\Models\Com\UpdateOldInfo; | @@ -14,6 +14,8 @@ use App\Models\Com\UpdateOldInfo; | ||
| 14 | use App\Models\Domain\DomainInfo; | 14 | use App\Models\Domain\DomainInfo; |
| 15 | use App\Models\Inquiry\InquiryFormData; | 15 | use App\Models\Inquiry\InquiryFormData; |
| 16 | use App\Models\Project\Project; | 16 | use App\Models\Project\Project; |
| 17 | +use App\Models\Visit\Visit; | ||
| 18 | +use App\Models\Visit\VisitItem; | ||
| 17 | use App\Services\ProjectServer; | 19 | use App\Services\ProjectServer; |
| 18 | use Illuminate\Console\Command; | 20 | use Illuminate\Console\Command; |
| 19 | use Illuminate\Support\Facades\DB; | 21 | use Illuminate\Support\Facades\DB; |
| @@ -160,14 +162,12 @@ class MonthCountDate extends Command | @@ -160,14 +162,12 @@ class MonthCountDate extends Command | ||
| 160 | * @time :2024/1/8 11:02 | 162 | * @time :2024/1/8 11:02 |
| 161 | */ | 163 | */ |
| 162 | public function pv_ip(&$arr,$start,$end,$project_id){ | 164 | public function pv_ip(&$arr,$start,$end,$project_id){ |
| 163 | - $pv_ip = DB::table('gl_count') | ||
| 164 | - ->where(['project_id'=>$project_id]) | ||
| 165 | - ->where('date','>=',$start.' 00:00:00') | ||
| 166 | - ->where('date','<=',$end.' 23:59:59') | ||
| 167 | - ->select(DB::raw('SUM(pv_num) as pv_num'), DB::raw('SUM(ip_num) as ip_num'),DB::raw('SUM(inquiry_num) as inquiry_num')) | ||
| 168 | - ->first(); | ||
| 169 | - $arr['pv'] = $pv_ip->pv_num; | ||
| 170 | - $arr['ip'] = $pv_ip->ip_num; | 165 | + $arr['pv'] = (new VisitItem()) |
| 166 | + ->where('updated_date','>=',$start.' 00:00:00') | ||
| 167 | + ->where('updated_date','<=',$end.' 23:59:59')->count(); | ||
| 168 | + $arr['ip'] = (new Visit()) | ||
| 169 | + ->where('updated_date','>=',$start.' 00:00:00') | ||
| 170 | + ->where('updated_date','<=',$end.' 23:59:59')->count(); | ||
| 171 | if($arr['ip'] != 0){ | 171 | if($arr['ip'] != 0){ |
| 172 | $arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 10,2); | 172 | $arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 10,2); |
| 173 | } | 173 | } |
-
请 注册 或 登录 后发表评论