作者 Your Name
... ... @@ -114,9 +114,7 @@ class RecommendedSuppliers extends Command
* @method :post
* @time :2024/7/1 18:07
*/
public function getKeywords($project_id){
$keywordModel = new Keyword();
$keywordModel->
public function getKeywords($project_id){git
$info = Keyword::inRandomOrder()->first();
$keywordInfo = $this->getPurchaser($info->title,$project_id);
if($keywordInfo !== false){
... ...
... ... @@ -39,7 +39,7 @@ class ServersIpController extends BaseController
}
$serversIpModel = new ServersIpModel();
$this->map['status'] = 0;
$data = $serversIpModel->list($this->map,'total');
$data = $serversIpModel->list($this->map,'total',['*'],'asc');
foreach ($data as $k => $v){
$v['is_optional'] = 0;//是否可选择
if($v['total'] >= $info['ip_total']){
... ...
... ... @@ -31,6 +31,23 @@ class BTemplateController extends BaseController
}
/**
* @remark :获取数据详情
* @name :templateInfo
* @author :lyh
* @method :post
* @time :2024/7/31 14:27
*/
public function publicInfo(BTemplateLogic $BTemplateLogic){
$this->request->validate([
'id'=>'required',
],[
'id.required' => 'id不能为空',
]);
$info = $BTemplateLogic->getPublicTemplateInfo();
$this->response('success',Code::SUCCESS,$info);
}
/**
* @remark :获取用户模版id
* @name :getUserTemplate
* @author :lyh
... ...
... ... @@ -52,6 +52,19 @@ class BTemplateLogic extends BaseLogic
}
/**
* @remark :获取模版详情
* @name :getPublicTemplateInfo
* @author :lyh
* @method :post
* @time :2024/7/31 14:31
*/
public function getPublicTemplateInfo(){
$templateModel = new Template();
$info = $templateModel->read($this->param);
return $this->success($info);
}
/**
* @remark :获取可视化html
* @name :getTemplateHtml
* @author :lyh
... ...
... ... @@ -126,7 +126,9 @@ class CustomTemplateLogic extends BaseLogic
if($bSettingInfo === false){
$this->fail('请先选择模版');
}
$this->saveCommonTemplate($html,$bSettingInfo['template_id']);
if(!isset($this->param['template_status'])){//代表直接替换模版 不更新头部底部
$this->saveCommonTemplate($html,$bSettingInfo['template_id']);
}
$this->param['html'] = characterTruncation($html,'/<main\b[^>]*>(.*?)<\/main>/s');
$this->param['html_style'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s');
}
... ...
... ... @@ -193,8 +193,11 @@ class BlogLogic extends BaseLogic
* @time :2023/10/20 9:02
*/
public function getCategory($category){
if(empty($category)){
return '';
}
$str = implode(',',$category);
return !empty(trim(trim($str,','),',')) ? ','.$str.',' : '';
return !empty(trim(trim($str,','),',')) ? ','.trim(trim($str,','),',').',' : '';
}
/**
... ...
... ... @@ -213,7 +213,7 @@ class NewsLogic extends BaseLogic
*/
public function getCategory($category){
$str = implode(',',$category);
return !empty(trim(trim($str,','),',')) ? ','.$str.',' : '';
return !empty(trim(trim($str,','),',')) ? ','.trim(trim($str,','),',').',' : '';
}
/**
... ...
... ... @@ -356,6 +356,7 @@ Route::middleware(['bloginauth'])->group(function () {
Route::prefix('template')->group(function () {
//获取所有公共主题模版
Route::any('/publicTemplateLists', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'publicTemplateLists'])->name('template_publicTemplateLists');
Route::any('/publicInfo', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'publicInfo'])->name('template_publicInfo');
//获取选中的主题模版
Route::any('/getPublicTemplate', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'getPublicTemplate'])->name('template_getPublicTemplate');
Route::any('/getTemplate', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'getTemplate'])->name('template_getTemplate');
... ...