Merge branch 'develop' into dc
正在显示
5 个修改的文件
包含
14 行增加
和
64 行删除
| @@ -6,6 +6,7 @@ use App\Helper\Common; | @@ -6,6 +6,7 @@ use App\Helper\Common; | ||
| 6 | use App\Helper\FormGlobalsoApi; | 6 | use App\Helper\FormGlobalsoApi; |
| 7 | use App\Models\CustomerVisit\CustomerVisitItem; | 7 | use App\Models\CustomerVisit\CustomerVisitItem; |
| 8 | use App\Models\Project\DeployBuild; | 8 | use App\Models\Project\DeployBuild; |
| 9 | +use App\Models\Project\DeployOptimize; | ||
| 9 | use Carbon\Carbon; | 10 | use Carbon\Carbon; |
| 10 | use Illuminate\Console\Command; | 11 | use Illuminate\Console\Command; |
| 11 | use Illuminate\Support\Facades\DB; | 12 | use Illuminate\Support\Facades\DB; |
| @@ -35,7 +36,7 @@ class Yesterday extends Command | @@ -35,7 +36,7 @@ class Yesterday extends Command | ||
| 35 | */ | 36 | */ |
| 36 | public function handle() | 37 | public function handle() |
| 37 | { | 38 | { |
| 38 | - $deployModel = new DeployBuild(); | 39 | + $deployModel = new DeployOptimize(); |
| 39 | $list = $deployModel->list(); | 40 | $list = $deployModel->list(); |
| 40 | $data = []; | 41 | $data = []; |
| 41 | $yesterday = Carbon::yesterday()->toDateString(); | 42 | $yesterday = Carbon::yesterday()->toDateString(); |
| @@ -92,8 +92,8 @@ if(!function_exists('http_get')){ | @@ -92,8 +92,8 @@ if(!function_exists('http_get')){ | ||
| 92 | curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, false); | 92 | curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, false); |
| 93 | curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, false); | 93 | curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, false); |
| 94 | $access_txt = curl_exec($ch1); | 94 | $access_txt = curl_exec($ch1); |
| 95 | + \Illuminate\Support\Facades\Log::info($access_txt); | ||
| 95 | curl_close($ch1); | 96 | curl_close($ch1); |
| 96 | - \Illuminate\Support\Facades\Log::info('info----'.$access_txt); | ||
| 97 | return json_decode($access_txt, true); | 97 | return json_decode($access_txt, true); |
| 98 | } | 98 | } |
| 99 | } | 99 | } |
| @@ -8,6 +8,7 @@ use App\Http\Controllers\Controller; | @@ -8,6 +8,7 @@ use App\Http\Controllers\Controller; | ||
| 8 | use App\Http\Requests\Bside\Nav\NavRequest; | 8 | use App\Http\Requests\Bside\Nav\NavRequest; |
| 9 | use App\Http\Requests\Scene; | 9 | use App\Http\Requests\Scene; |
| 10 | use App\Models\Project\DeployBuild; | 10 | use App\Models\Project\DeployBuild; |
| 11 | +use App\Models\Project\DeployOptimize; | ||
| 11 | use App\Models\User\User as UserModel; | 12 | use App\Models\User\User as UserModel; |
| 12 | use Illuminate\Http\JsonResponse; | 13 | use Illuminate\Http\JsonResponse; |
| 13 | use Illuminate\Http\Request; | 14 | use Illuminate\Http\Request; |
| @@ -46,8 +47,7 @@ class BaseController extends Controller | @@ -46,8 +47,7 @@ class BaseController extends Controller | ||
| 46 | } | 47 | } |
| 47 | } | 48 | } |
| 48 | /** | 49 | /** |
| 49 | - * @name 参数过滤 | ||
| 50 | - * @return void | 50 | + * @name :参数过滤 |
| 51 | * @author :liyuhang | 51 | * @author :liyuhang |
| 52 | * @method | 52 | * @method |
| 53 | */ | 53 | */ |
| @@ -211,15 +211,15 @@ class BaseController extends Controller | @@ -211,15 +211,15 @@ class BaseController extends Controller | ||
| 211 | } | 211 | } |
| 212 | 212 | ||
| 213 | /** | 213 | /** |
| 214 | - * @name :(获取当前登录用户域名)projectUrl | 214 | + * @name :(获取当前登录用户域名并通知更新)projectUrl |
| 215 | * @author :lyh | 215 | * @author :lyh |
| 216 | * @method :post | 216 | * @method :post |
| 217 | * @time :2023/6/6 14:09 | 217 | * @time :2023/6/6 14:09 |
| 218 | */ | 218 | */ |
| 219 | public function projectUrlNotify($param){ | 219 | public function projectUrlNotify($param){ |
| 220 | - $deployBuildModel = new DeployBuild(); | ||
| 221 | - $info = $deployBuildModel->read(['project_id'=>$this->user['project_id']]); | ||
| 222 | - $url = $info['test_domain'].'/api/updateHtmlNotify?model='.$param; | 220 | + $deployBuildModel = new DeployOptimize(); |
| 221 | + $info = $deployBuildModel->read(['project_id'=>1]); | ||
| 222 | + $url = $info['test_domain'].'api/updateHtmlNotify?model='.$param; | ||
| 223 | return http_get($url); | 223 | return http_get($url); |
| 224 | } | 224 | } |
| 225 | } | 225 | } |
| @@ -159,53 +159,6 @@ class ComController extends BaseController | @@ -159,53 +159,6 @@ class ComController extends BaseController | ||
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | public function ceshi(){ | 161 | public function ceshi(){ |
| 162 | - $this->error = 0; | ||
| 163 | - //获取所有ayr_share用户 | ||
| 164 | - $ayr_share_model = new AyrShareModel(); | ||
| 165 | - $ayr_share_list = $ayr_share_model->list(); | ||
| 166 | - foreach ($ayr_share_list as $k => $v){ | ||
| 167 | - //查询当前用户是否有未推送的博文 | ||
| 168 | - $ayr_release = new AyrReleaseModel(); | ||
| 169 | - $release_info = $ayr_release->read(['schedule_date'=>['>',date('Y-m-d H:i:s',time())],'share_id'=>$v['id']]); | ||
| 170 | - //有推文时,直接跳出循环 | ||
| 171 | - if($release_info !== false){ | ||
| 172 | - echo 1; | ||
| 173 | - continue; | ||
| 174 | - } | ||
| 175 | - //查看用户是否在一周内有发送博客 | ||
| 176 | - $start_at = Carbon::now()->modify('-7 days')->toDateString(); | ||
| 177 | - $end_at = Carbon::now()->toDateString(); | ||
| 178 | - $release_info = $ayr_release->read(['created_at'=>['between',[$start_at,$end_at]]]); | ||
| 179 | - //有发送博文,则跳出循环 | ||
| 180 | - if($release_info !== false){ | ||
| 181 | - echo 2; | ||
| 182 | - continue; | ||
| 183 | - } | ||
| 184 | - //删除用户第三方配置 | ||
| 185 | - if(!empty($v['profile_key'])){ | ||
| 186 | - $ayr_share_helper = new AyrShareHelper(); | ||
| 187 | - $data_profiles = [ | ||
| 188 | - 'title'=>$v['title'], | ||
| 189 | - 'profileKey'=>$v['profile_key'] | ||
| 190 | - ]; | ||
| 191 | - $res = $ayr_share_helper->deleted_profiles($data_profiles); | ||
| 192 | - if($res['status'] == 'fail'){ | ||
| 193 | - echo 3; | ||
| 194 | - continue; | ||
| 195 | - } | ||
| 196 | - } | ||
| 197 | - //更新数据库 | ||
| 198 | - $data = [ | ||
| 199 | - 'title'=>'', | ||
| 200 | - 'bind_platforms'=>'', | ||
| 201 | - 'profile_key'=>'', | ||
| 202 | - 'ref_id'=>'', | ||
| 203 | - ]; | ||
| 204 | - $res = $ayr_share_model->edit($data,['id'=>$v['id']]); | ||
| 205 | - if($res == false){ | ||
| 206 | - echo 4; | ||
| 207 | - } | ||
| 208 | - } | ||
| 209 | - return $this->error; | 162 | + return $this->projectUrlNotify('news'); |
| 210 | } | 163 | } |
| 211 | } | 164 | } |
| @@ -3,14 +3,12 @@ | @@ -3,14 +3,12 @@ | ||
| 3 | namespace App\Http\Controllers\Bside\News; | 3 | namespace App\Http\Controllers\Bside\News; |
| 4 | 4 | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | -use App\Helper\Common; | ||
| 7 | use App\Http\Controllers\Bside\BaseController; | 6 | use App\Http\Controllers\Bside\BaseController; |
| 8 | use App\Http\Logic\Bside\News\NewsCategoryLogic; | 7 | use App\Http\Logic\Bside\News\NewsCategoryLogic; |
| 9 | use App\Http\Logic\Bside\News\NewsLogic; | 8 | use App\Http\Logic\Bside\News\NewsLogic; |
| 10 | use App\Http\Requests\Bside\News\NewsRequest; | 9 | use App\Http\Requests\Bside\News\NewsRequest; |
| 11 | use App\Models\News\News as NewsModel; | 10 | use App\Models\News\News as NewsModel; |
| 12 | -use Illuminate\Http\Request; | ||
| 13 | -use Illuminate\Support\Facades\DB; | 11 | + |
| 14 | 12 | ||
| 15 | /** | 13 | /** |
| 16 | * @name:新闻管理 | 14 | * @name:新闻管理 |
| @@ -72,8 +70,8 @@ class NewsController extends BaseController | @@ -72,8 +70,8 @@ class NewsController extends BaseController | ||
| 72 | $newsRequest->validated(); | 70 | $newsRequest->validated(); |
| 73 | $newsLogic->news_add(); | 71 | $newsLogic->news_add(); |
| 74 | //TODO::通知网站更新 | 72 | //TODO::通知网站更新 |
| 75 | - $this->projectUrlNotify($this->model); | ||
| 76 | - $this->response('success'); | 73 | + $res = $this->projectUrlNotify($this->model); |
| 74 | + $this->response('success',Code::SUCCESS,$res); | ||
| 77 | } | 75 | } |
| 78 | 76 | ||
| 79 | /** | 77 | /** |
| @@ -91,9 +89,7 @@ class NewsController extends BaseController | @@ -91,9 +89,7 @@ class NewsController extends BaseController | ||
| 91 | $newsLogic->news_edit(); | 89 | $newsLogic->news_edit(); |
| 92 | //TODO::通知网站更新 | 90 | //TODO::通知网站更新 |
| 93 | $res = $this->projectUrlNotify($this->model); | 91 | $res = $this->projectUrlNotify($this->model); |
| 94 | - var_dump($res); | ||
| 95 | - die(); | ||
| 96 | - $this->response('success'); | 92 | + $this->response('success',Code::SUCCESS,$res); |
| 97 | } | 93 | } |
| 98 | 94 | ||
| 99 | /** | 95 | /** |
-
请 注册 或 登录 后发表评论