作者 lyh

gx

... ... @@ -77,9 +77,13 @@ class ProjectVisit extends Command
if (isset($data['count']) && $data['count'] > 0) {
$count = $data['count'];
$max_id = $data['data'][0]['id'] ?? 0;
$is_stop = 0;
$total_page = ceil($count / $page_size);
for ($page = 1; $page <= $total_page; $page++) {
if ($is_stop) {
break;
}
$url_page = $api_url . '?' . http_build_query(['w' => 'visit_list', 'page' => $page, 'pagesize' => $page_size]);
$data_page = curl_c($url_page);
if (isset($data_page['data']) && $data_page['data']) {
... ... @@ -104,9 +108,13 @@ class ProjectVisit extends Command
'updated_date' => date('Y-m-d', isset($item['c_time']) && $item['c_time'] ? strtotime($item['c_time']) : time()),
'original_id' => $item['id'],
];
} else {
$is_stop = 1;
break;
}
}
}
if ($insert) {
try {
$model->insert($insert);
} catch (\Exception $e) {
... ... @@ -115,9 +123,9 @@ class ProjectVisit extends Command
}
}
}
}
if ($max_id) {
$task->max_id = $max_id;
$task->save();
}
} else {
return true;
... ... @@ -129,9 +137,13 @@ class ProjectVisit extends Command
if (isset($data['count']) && $data['count'] > 0) {
$count = $data['count'];
$max_id = $data['data'][0]['id'] ?? 0;
$is_stop = 0;
$total_page = ceil($count / $page_size);
for ($page = 1; $page <= $total_page; $page++) {
if ($is_stop) {
break;
}
$url_page = $api_url . '?' . http_build_query(['w' => 'visit_detail_list', 'page' => $page, 'pagesize' => $page_size]);
$data_page = curl_c($url_page);
if (isset($data_page['data']) && $data_page['data']) {
... ... @@ -158,9 +170,13 @@ class ProjectVisit extends Command
'original_id' => $item['id'],
];
}
} else {
$is_stop = 1;
break;
}
}
}
if ($insert) {
try {
$model->insert($insert);
} catch (\Exception $e) {
... ... @@ -169,9 +185,9 @@ class ProjectVisit extends Command
}
}
}
}
if ($max_id) {
$task->max_id = $max_id;
$task->save();
}
} else {
return true;
... ...
... ... @@ -53,19 +53,13 @@ class UpdateRoute extends Command
* @time :2023/11/20 15:13
*/
public function handle(){
<<<<<<< HEAD
ProjectServer::useProject(91);
$this->getProductKeyword();
DB::disconnect('custom_mysql');
=======
$projectModel = new Project();
$list = $projectModel->list(['type'=>['in',[1,2,3,4]]]);
foreach ($list as $v){
ProjectServer::useProject($v['id']);
$this->getProductKeyword($v['id']);
$this->getProductKeyword();
DB::disconnect('custom_mysql');
}
>>>>>>> 66efe5cd4b835d715f00e164b101185541dd9f83
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
... ... @@ -76,22 +70,11 @@ class UpdateRoute extends Command
* @method :post
* @time :2023/12/8 11:13
*/
public function getProductKeyword($project_id){
public function getProductKeyword(){
$keywordModel = new Keyword();
$lists = $keywordModel->list(['status'=>1]);
if(!empty($lists)){
foreach ($lists as $v){
<<<<<<< HEAD
$tag = "-tag";
if (!substr($v['route'], -strlen($tag)) === $tag) {
$route = $v['route'].$tag;
// 如果不是以 '-tag' 结尾,则拼接上 '-tag'
$route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $this->user['project_id']);
$keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
=======
echo date('Y-m-d H:i:s') . '关键字id:'.$v['id'] . PHP_EOL;
$tag = "-tag";
if (!(substr($v['route'], -strlen($tag)) === $tag)) {
echo date('Y-m-d H:i:s') . '拼接'.$tag . PHP_EOL;
... ... @@ -101,7 +84,6 @@ class UpdateRoute extends Command
$routeModel->edit(['route'=>$route],['source'=>RouteMap::SOURCE_PRODUCT_KEYWORD,'source_id'=>$v['id']]);
$keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
}
>>>>>>> 66efe5cd4b835d715f00e164b101185541dd9f83
}
}
}
... ...
... ... @@ -667,6 +667,13 @@ class BTemplateLogic extends BaseLogic
* @method :any
* @time :2023/7/17 16:03
*/
/**
* @remark :获取类型
* @name :getModuleType
* @author :lyh
* @method :any
* @time :2023/7/17 16:03
*/
public function getModuleType(): array
{
//定义数据结构
... ... @@ -707,7 +714,6 @@ class BTemplateLogic extends BaseLogic
return $this->success($data);
}
/**
* @remark :保存html
* @name :savePublicTemplateHtml
... ...