|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @remark :
|
|
|
|
* @name :CNoticeController.php
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/12 10:04
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Aside\Com;
|
|
|
|
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Http\Controllers\Aside\BaseController;
|
|
|
|
use App\Models\Domain\DomainInfo;
|
|
|
|
use App\Models\Project\Country as CountryModel;
|
|
|
|
use App\Models\Project\DeployBuild;
|
|
|
|
use App\Models\WebSetting\WebLanguage;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :通知C端
|
|
|
|
* @name :CNoticeController
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/12 10:38
|
|
|
|
*/
|
|
|
|
class CNoticeController extends BaseController
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* 更新通知C端
|
|
|
|
* @param Request $request
|
|
|
|
* @return \Illuminate\Http\JsonResponse
|
|
|
|
*/
|
|
|
|
public function sendNotify(Request $request)
|
|
|
|
{
|
|
|
|
//获取当前项目的域名
|
|
|
|
$domainModel = new DomainInfo();
|
|
|
|
$domainInfo = $domainModel->read(['project_id'=>$this->param['project_id']]);
|
|
|
|
if($domainInfo === false){
|
|
|
|
//获取测试域名
|
|
|
|
$deployBuildModel = new DeployBuild();
|
|
|
|
$buildInfo = $deployBuildModel->read(['project_id'=>$this->param['project_id']]);
|
|
|
|
$this->param['domain'] = $buildInfo['test_domain'];
|
|
|
|
}else{
|
|
|
|
$this->param['domain'] = 'https://'.$domainInfo['domain'].'/';
|
|
|
|
}
|
|
|
|
$url = $this->param['domain'].'api/update_page/';
|
|
|
|
$param = [
|
|
|
|
'project_id' => $this->param['project_id'],
|
|
|
|
'type' => intval($request->input('type', 1)),
|
|
|
|
'route' => intval($request->input('page', 1)),
|
|
|
|
'url' => $request->input('url', []),
|
|
|
|
'language'=> $request->input('language', []),
|
|
|
|
];
|
|
|
|
http_post($url, json_encode($param));
|
|
|
|
$this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取当前项目选中的语种
|
|
|
|
* @name :getCountry
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/12 15:20
|
|
|
|
*/
|
|
|
|
public function getCountry(){
|
|
|
|
$countryModel = new CountryModel();
|
|
|
|
$info = $countryModel->read(['project_id'=>$this->param['project_id']],['id','country_lists']);
|
|
|
|
$ids = [];
|
|
|
|
if($info !== false){
|
|
|
|
$ids = explode(',',$info['country_lists']);
|
|
|
|
}
|
|
|
|
$languageModel = new WebLanguage();
|
|
|
|
//根据排序查询选中的小语种
|
|
|
|
$lists = $languageModel->whereIn('id', $ids)->orderByRaw(DB::raw("FIND_IN_SET(id,'" . implode(',', $ids) . "'" . ')'))->get()->toArray();
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|