|
@@ -3,14 +3,19 @@ |
|
@@ -3,14 +3,19 @@ |
|
3
|
namespace App\Http\Controllers\Bside;
|
3
|
namespace App\Http\Controllers\Bside;
|
|
4
|
|
4
|
|
|
5
|
use App\Enums\Common\Code;
|
5
|
use App\Enums\Common\Code;
|
|
|
|
6
|
+use App\Helper\Common;
|
|
|
|
7
|
+use App\Helper\FormGlobalsoApi;
|
|
|
|
8
|
+use App\Models\Project\DeployBuild;
|
|
6
|
use App\Models\Project\Project;
|
9
|
use App\Models\Project\Project;
|
|
7
|
use App\Models\Project\Project as ProjectModel;
|
10
|
use App\Models\Project\Project as ProjectModel;
|
|
8
|
use App\Models\SmsLog;
|
11
|
use App\Models\SmsLog;
|
|
9
|
use App\Models\User\ProjectMenu as ProjectMenuModel;
|
12
|
use App\Models\User\ProjectMenu as ProjectMenuModel;
|
|
10
|
use App\Models\User\ProjectRole as ProjectRoleModel;
|
13
|
use App\Models\User\ProjectRole as ProjectRoleModel;
|
|
11
|
use App\Models\User\User as UserModel;
|
14
|
use App\Models\User\User as UserModel;
|
|
|
|
15
|
+use Carbon\Carbon;
|
|
12
|
use Illuminate\Http\Request;
|
16
|
use Illuminate\Http\Request;
|
|
13
|
use Illuminate\Support\Facades\Cache;
|
17
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
18
|
+use Illuminate\Support\Facades\DB;
|
|
14
|
use Mrgoon\AliSms\AliSms;
|
19
|
use Mrgoon\AliSms\AliSms;
|
|
15
|
|
20
|
|
|
16
|
/***
|
21
|
/***
|
|
@@ -150,4 +155,35 @@ class ComController extends BaseController |
|
@@ -150,4 +155,35 @@ class ComController extends BaseController |
|
150
|
return $this->response('success');
|
155
|
return $this->response('success');
|
|
151
|
}
|
156
|
}
|
|
152
|
|
157
|
|
|
|
|
158
|
+ public function ceshi(){
|
|
|
|
159
|
+ $deployModel = new DeployBuild();
|
|
|
|
160
|
+ $list = $deployModel->list();
|
|
|
|
161
|
+ $data = [];
|
|
|
|
162
|
+ $yesterday = Carbon::yesterday()->toDateString();
|
|
|
|
163
|
+ foreach ($list as $v){
|
|
|
|
164
|
+ $arr = [];
|
|
|
|
165
|
+ $arr['yesterday_pv_num'] = DB::table('gl_customer_visit_item')->whereDate('date', $yesterday)->where('domain',$v['test_domain'])->count();
|
|
|
|
166
|
+ $arr['yesterday_ip_num'] = DB::table('gl_customer_visit')->whereDate('date', $yesterday)->where('domain',$v['test_domain'])->count();
|
|
|
|
167
|
+ $inquiry_list = (new FormGlobalsoApi())->getInquiryList($v['test_domain']);
|
|
|
|
168
|
+ if($inquiry_list['status'] == 400){
|
|
|
|
169
|
+ $arr['inquiry_num'] = 0;
|
|
|
|
170
|
+ }else{
|
|
|
|
171
|
+ $arr['inquiry_num'] = count($inquiry_list['data']['total']);
|
|
|
|
172
|
+ }
|
|
|
|
173
|
+ $arr['date'] = $yesterday;
|
|
|
|
174
|
+ $rank_info = DB::table('gl_rank_data')->where(['updated_date'=>$yesterday,'lang'=>''])->select(['compliance_day'])->first();
|
|
|
|
175
|
+ if(empty($rank_info)){
|
|
|
|
176
|
+ $arr['compliance_day'] = 0;
|
|
|
|
177
|
+ }else{
|
|
|
|
178
|
+ $arr['compliance_day'] = $rank_info->compliance_day;
|
|
|
|
179
|
+ }
|
|
|
|
180
|
+ $arr['service_day'] = $v['service_duration'] - Common::getDaysToTargetDate($v['created_at']);
|
|
|
|
181
|
+ $arr['project_id'] = $v['project_id'];
|
|
|
|
182
|
+ $arr['created_at'] = date('Y-m-d H:i:s');
|
|
|
|
183
|
+ $arr['updated_at'] = date('Y-m-d H:i:s');
|
|
|
|
184
|
+ $data[] = $arr;
|
|
|
|
185
|
+ }
|
|
|
|
186
|
+ DB::table('gl_count')->insert($data);
|
|
|
|
187
|
+ echo $this->error;
|
|
|
|
188
|
+ }
|
|
153
|
} |
189
|
} |