作者 邓超

Merge branch 'develop' into dc

... ... @@ -6,6 +6,7 @@ use App\Helper\Common;
use App\Helper\FormGlobalsoApi;
use App\Models\CustomerVisit\CustomerVisitItem;
use App\Models\Project\DeployBuild;
use App\Models\Project\DeployOptimize;
use Carbon\Carbon;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
... ... @@ -35,7 +36,7 @@ class Yesterday extends Command
*/
public function handle()
{
$deployModel = new DeployBuild();
$deployModel = new DeployOptimize();
$list = $deployModel->list();
$data = [];
$yesterday = Carbon::yesterday()->toDateString();
... ...
... ... @@ -92,8 +92,8 @@ if(!function_exists('http_get')){
curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, false);
$access_txt = curl_exec($ch1);
\Illuminate\Support\Facades\Log::info($access_txt);
curl_close($ch1);
\Illuminate\Support\Facades\Log::info('info----'.$access_txt);
return json_decode($access_txt, true);
}
}
... ...
... ... @@ -8,6 +8,7 @@ use App\Http\Controllers\Controller;
use App\Http\Requests\Bside\Nav\NavRequest;
use App\Http\Requests\Scene;
use App\Models\Project\DeployBuild;
use App\Models\Project\DeployOptimize;
use App\Models\User\User as UserModel;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
... ... @@ -46,8 +47,7 @@ class BaseController extends Controller
}
}
/**
* @name 参数过滤
* @return void
* @name :参数过滤
* @author :liyuhang
* @method
*/
... ... @@ -211,15 +211,15 @@ class BaseController extends Controller
}
/**
* @name :(获取当前登录用户域名)projectUrl
* @name :(获取当前登录用户域名并通知更新)projectUrl
* @author :lyh
* @method :post
* @time :2023/6/6 14:09
*/
public function projectUrlNotify($param){
$deployBuildModel = new DeployBuild();
$info = $deployBuildModel->read(['project_id'=>$this->user['project_id']]);
$url = $info['test_domain'].'/api/updateHtmlNotify?model='.$param;
$deployBuildModel = new DeployOptimize();
$info = $deployBuildModel->read(['project_id'=>1]);
$url = $info['test_domain'].'api/updateHtmlNotify?model='.$param;
return http_get($url);
}
}
... ...
... ... @@ -159,53 +159,6 @@ class ComController extends BaseController
}
public function ceshi(){
$this->error = 0;
//获取所有ayr_share用户
$ayr_share_model = new AyrShareModel();
$ayr_share_list = $ayr_share_model->list();
foreach ($ayr_share_list as $k => $v){
//查询当前用户是否有未推送的博文
$ayr_release = new AyrReleaseModel();
$release_info = $ayr_release->read(['schedule_date'=>['>',date('Y-m-d H:i:s',time())],'share_id'=>$v['id']]);
//有推文时,直接跳出循环
if($release_info !== false){
echo 1;
continue;
}
//查看用户是否在一周内有发送博客
$start_at = Carbon::now()->modify('-7 days')->toDateString();
$end_at = Carbon::now()->toDateString();
$release_info = $ayr_release->read(['created_at'=>['between',[$start_at,$end_at]]]);
//有发送博文,则跳出循环
if($release_info !== false){
echo 2;
continue;
}
//删除用户第三方配置
if(!empty($v['profile_key'])){
$ayr_share_helper = new AyrShareHelper();
$data_profiles = [
'title'=>$v['title'],
'profileKey'=>$v['profile_key']
];
$res = $ayr_share_helper->deleted_profiles($data_profiles);
if($res['status'] == 'fail'){
echo 3;
continue;
}
}
//更新数据库
$data = [
'title'=>'',
'bind_platforms'=>'',
'profile_key'=>'',
'ref_id'=>'',
];
$res = $ayr_share_model->edit($data,['id'=>$v['id']]);
if($res == false){
echo 4;
}
}
return $this->error;
return $this->projectUrlNotify('news');
}
}
... ...
... ... @@ -3,14 +3,12 @@
namespace App\Http\Controllers\Bside\News;
use App\Enums\Common\Code;
use App\Helper\Common;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\News\NewsCategoryLogic;
use App\Http\Logic\Bside\News\NewsLogic;
use App\Http\Requests\Bside\News\NewsRequest;
use App\Models\News\News as NewsModel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
/**
* @name:新闻管理
... ... @@ -72,8 +70,8 @@ class NewsController extends BaseController
$newsRequest->validated();
$newsLogic->news_add();
//TODO::通知网站更新
$this->projectUrlNotify($this->model);
$this->response('success');
$res = $this->projectUrlNotify($this->model);
$this->response('success',Code::SUCCESS,$res);
}
/**
... ... @@ -91,9 +89,7 @@ class NewsController extends BaseController
$newsLogic->news_edit();
//TODO::通知网站更新
$res = $this->projectUrlNotify($this->model);
var_dump($res);
die();
$this->response('success');
$this->response('success',Code::SUCCESS,$res);
}
/**
... ...