作者 zhl

Merge remote-tracking branch 'origin/master' into zhl

... ... @@ -52,9 +52,9 @@ class LyhImportTest extends Command
* @time :2023/11/20 15:13
*/
public function handle(){
ProjectServer::useProject(3951);
ProjectServer::useProject(3654);
echo date('Y-m-d H:i:s') . 'start' . PHP_EOL;
$this->import2140CustomModule('https://ecdn6.globalso.com/upload/p/2140/file/2025-05/daoru.csv',3951);
$this->importProductCategory('https://ecdn6-nc.globalso.com/upload/p/3654/file/2025-06/products-1.csv',3654);
DB::disconnect('custom_mysql');
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
... ... @@ -129,23 +129,43 @@ class LyhImportTest extends Command
if($k < 1){
continue;
}
if(empty($val[1])){
echo '跳过的名称:'.$val[1];
if(empty($val[0])){
echo '跳过的名称:'.$val[0];
continue;
}
try {
$categoryModel->edit(['sort'=>$val[1]],['title'=>$val[0]]);
// $id = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$val[1],'seo_title'=>$val[0],'seo_des'=>$val[2]]);
// $pid = 0;
// if($val[2] != 0){
// //查询上级id
// $pidCate = $categoryModel->read(['seo_title'=>$val[2]]);
// if($pidCate !== false){
// $pid = $pidCate['id'];
// }
// }
// $route = RouteMap::setRoute($val[1],RouteMap::SOURCE_PRODUCT_CATE,$id,$project_id);
// $categoryModel->edit(['route'=>$route,'pid'=>$pid],['id'=>$id]);
$cateArr = explode('/',$val[0]);
$pid = 0;
$two_pid = 0;
foreach ($cateArr as $key => $item){
if($key == 0){
//查看一级分类是否存在
$info = $categoryModel->read(['title'=>$item,'pid'=>0],['id']);
if($info === false){
$pid = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$item]);
//设置路由
$route = RouteMap::setRoute($item,RouteMap::SOURCE_PRODUCT_CATE,$pid,$project_id);
$categoryModel->edit(['route'=>$route],['id'=>$pid]);
}else{
$pid = $info['id'];
}
}elseif ($key == 1){
//查看当前下面的子级别是否存在
$two_info = $categoryModel->read(['title'=>$item,'pid'=>$pid],['id']);
if($two_info === false){
$two_pid = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$item,'pid'=>$pid]);
//设置路由
$route = RouteMap::setRoute($item,RouteMap::SOURCE_PRODUCT_CATE,$two_pid,$project_id);
$categoryModel->edit(['route'=>$route],['id'=>$two_pid]);
}else{
$two_pid = $two_info['id'];
}
}else{
$id = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$item,'pid'=>$two_pid]);
$route = RouteMap::setRoute($item,RouteMap::SOURCE_PRODUCT_CATE,$id,$project_id);
$categoryModel->edit(['route'=>$route],['id'=>$id]);
}
}
echo date('Y-m-d H:i:s') . '产品分类id:'.PHP_EOL;
}catch (\Exception $e){
echo date('Y-m-d H:i:s') . '跳过的名称:'. $val[1];
... ...
... ... @@ -35,7 +35,6 @@ class UpdateKeyword extends Command
public function handle(){
dd(1111);
while (true){
$keywordPageModel = new KeywordPage();
$lists = $keywordPageModel->list(['status'=>0]);
... ...
... ... @@ -142,7 +142,7 @@ class IndexController extends BaseController
Cache::add($token,$info,12 * 3600);
$languageModel = new WebLanguage();
$languageInfo = $languageModel->read(['id'=>$info['main_lang_id']],['short','english','chinese']);
$data = ['token'=>$token,'main_lang_id'=>$info['main_lang_id'],'language_info'=>$languageInfo];
$data = ['token'=>$token,'main_lang_id'=>$info['main_lang_id'],'language_info'=>$languageInfo,'project_seo_type'=>$info['project_seo_type']];
$this->response('success',Code::SUCCESS,$data);
}
... ...
... ... @@ -210,7 +210,7 @@ class CNoticeController extends BaseController
* 更新通知C端
* @param Request $request
* @return \Illuminate\Http\JsonResponse
* @param : type : 1->主站更新 4->聚合页更新
* @param : type : 1->主站更新 4->聚合页更新 7->ai博客
*/
public function sendNotify(Request $request)
{
... ...
... ... @@ -93,7 +93,7 @@ class OperationHeartbeatController extends BaseController
if($info === false){
$info = [];
}else{
$date_time = strtotime($info['updated_at']) + 120;
$date_time = strtotime($info['updated_at']) + 60;
if($date_time < time()){
$operationHeartbeatModel->edit(['status'=>0,'ip'=>'127.0.0.1'],$condition);
$info['status'] = 0;
... ...
... ... @@ -347,11 +347,11 @@ class KeywordController extends BaseController
*/
public function sendComment(KeywordLogic $logic){
$this->request->validate([
'count' => 'required|integer|max:10',
'count' => 'required|integer|max:100',
], [
'count.required' => '生成条数不能为空',
'count.integer' => '生成条数必须是整数',
'count.max' => '生成条数最大不能超过10',
'count.max' => '生成条数最大不能超过100',
]);
$data = $logic->sendComment();
$this->response('success',Code::SUCCESS,$data);
... ...
... ... @@ -359,7 +359,7 @@ class ProductController extends BaseController
}
if (!empty($new_content)){
$detailModel = new Detail();
$detailInfo = $detailModel->read(['column_id'=>1]);
$detailInfo = $detailModel->read(['column_id'=>1,'product_id'=>$this->param['product_id']]);
if($detailInfo !== false && !empty($detailInfo['content'])){
$productInfo['content'] = $new_content . $detailInfo['content']['content'];
}
... ...
... ... @@ -26,6 +26,7 @@ class AutoPullNotify extends Base
22 => '白帽专属服务器01',
24 => '白帽专属服务器02',
23 => '西班牙服务器',
6 => '自建站服务器群',
];
}
... ...