作者 lyh

gx

... ... @@ -9,7 +9,10 @@
namespace App\Http\Controllers\Bside\BCom;
use App\Helper\Common;
use App\Http\Controllers\Bside\BaseController;
use App\Models\Blog\Blog;
use App\Models\News\News;
use App\Models\Product\Product;
/**
... ... @@ -42,23 +45,76 @@ class UpdateController extends BaseController
public function updateProduct(){
$productModel = new Product();
$list = $productModel->list(['status'=>Product::STATUS_ON,'project_id'=>$this->user['project_id'],'deleted_at'=>null]);
foreach ($list as $k => $v){
if(!empty($v['seo_mate'])){
$seo_arr = json_decode($v['seo_mate']);
//更新seo_title
if(!isset($seo_arr['title']) || empty($seo_arr['title'])){
if(!empty($list)){
foreach ($list as $k => $v){
if(!empty($v['seo_mate'])){
$seo_arr = json_decode($v['seo_mate']);
//更新seo_title
if(!isset($seo_arr['title'])){
//生成seo_title
$seo_arr['title'] = Com;
}
//更新seo_keyword
if(!isset($seo_arr['keyword'])){
$seo_arr['keyword'] = 1;
}
//更新seo_keyword
if(!isset($seo_arr['description'])){
$seo_arr['description'] = 1;
}
}
//更新seo_keyword
if(!isset($seo_arr['keyword']) || empty($seo_arr['keyword'])){
}
}
}
}
/**
* @remark :更新新闻Tdk
* @name :updateNews
* @author :lyh
* @method :post
* @time :2023/8/19 10:06
*/
public function updateNews(){
$newsModel = new News();
$list = $newsModel->list(['status'=>$newsModel::STATUS_ONE]);
if(!empty($list)){
foreach ($list as $k => $v){
//更新seo_keyword
if(!isset($seo_arr['keyword']) || empty($seo_arr['keyword'])){
}
}
}
/**
* @remark :更新blogTdk
* @name :updateBlogs
* @author :lyh
* @method :post
* @time :2023/8/19 10:07
*/
public function updateBlogs(){
$blogModel = new Blog();
$list = $blogModel->list(['status'=>$blogModel::STATUS_ONE]);
if(!empty($list)){
foreach ($list as $k => $v){
}
}
}
}
/**
* @remark :AI发送
* @name :ai_send
* @author :lyh
* @method :post
* @time :2023/8/19 10:40
*/
public function ai_send($key,$keywords){
$chat_url = 'v2/openai_chat';
$param = [
'key'=>$key,
'keywords'=>$keywords,
];
$data = Common::send_openai_msg($chat_url,$param);
}
}
... ...
... ... @@ -26,7 +26,6 @@ class NavController extends BaseController
* @time 2023/5/8 16:37
*/
public function index(){
return $this->success(NavLogic::instance()->list());
}
... ...
... ... @@ -24,6 +24,12 @@ class CustomTemplateController extends BaseController
*/
public function lists(CustomTemplateLogic $customTemplateLogic){
$lists = $customTemplateLogic->customTemplateLists($this->map,$this->page,$this->row,$this->order);
if (!empty($lists)){
foreach ($lists['list'] as $k => $v){
$v['url'] = $this->user['domain'].$v['url'];
$lists['list'][$k] = $v;
}
}
$this->response('success',Code::SUCCESS,$lists);
}
... ...
... ... @@ -7,6 +7,7 @@ use App\Models\User\User;
class Blog extends Base
{
const STATUS_ONE = 1;
protected $table = 'gl_blog';
//连接数据库
protected $connection = 'custom_mysql';
... ...
... ... @@ -6,6 +6,8 @@ use App\Models\Base;
class News extends Base
{
const STATUS_ONE = 1;
protected $table = 'gl_news';
//连接数据库
protected $connection = 'custom_mysql';
... ...