作者 zhl

Merge branch 'master' of 47.244.231.31:zhl/globalso-v6 into zhl

正在显示 39 个修改的文件 包含 508 行增加171 行删除
... ... @@ -57,7 +57,9 @@ class RemainDay extends Command
foreach ($list as $item){
if($item['type'] == Project::TYPE_TWO){
//排名达标天数
$compliance_day = GoogleRankModel::where(['project_id' => $item['id'], 'lang' => ''])->value('compliance_day') ?: 0;
// $compliance_day = GoogleRankModel::where(['project_id' => $item['id'], 'lang' => ''])->value('compliance_day') ?: 0;
//获取当前项目的达标天数
$compliance_day = Project::where(['id' => $item['id']])->value('finish_remain_day') ?: 0;
$remain_day = $item['deploy_build']['service_duration'] - $compliance_day;
}else{
//审核上线后开始
... ...
<?php
/**
* @remark :
* @name :SyncMobile.php
* @author :lyh
* @method :post
* @time :2023/12/25 15:00
*/
namespace App\Console\Commands;
use App\Models\User\User;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class SyncMobile extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'sync_manager';
/**
* The console command description.
*
* @var string
*/
protected $description = '同步手机号码库';
/**
* @remark :统一更新路由
* @name :handle
* @author :lyh
* @method :post
* @time :2023/11/20 15:13
*/
public function handle(){
$url = 'https://www.quanqiusou.cn/extend_api/saas/get_phone.php';
$data = curlGet($url);//TODO::获取号码库
DB::table('gl_mobile')->delete();
$create_time = date('Y-m-d H:i:s');
foreach ($data as $v){
$param = [
'mobile'=>$v,
'created_at'=>$create_time
];
DB::table('gl_mobile')->insert($param);
}
if(!empty($data)){
$userModel = new User();
try {
$userModel->edit(['status'=>1],['project_id'=>1,'mobile'=>['not in',$data]]);
$userModel->edit(['status'=>0],['project_id'=>1,'mobile'=>['in',$data]]);
}catch (\Exception $e){
echo date('Y-m-d H:i:s') . 'error' . PHP_EOL;
}
}
}
}
... ...
... ... @@ -9,6 +9,7 @@ use App\Models\Channel\Channel;
use App\Models\Com\NoticeLog;
use App\Models\Com\UpdateLog;
use App\Models\Com\UpdateVisit;
use App\Models\Manage\Mobile;
use App\Models\Project\After;
use App\Models\Project\DeployBuild;
use App\Models\Project\DeployOptimize;
... ... @@ -201,7 +202,7 @@ class SyncProject extends Command
'is_upgrade'=>$is_update,
],
'deploy_build' => [
'service_duration' => $param['years'],
'service_duration' => $param['years'] ?? 0,
'plan' => $this->versionData($param['plan_marketing']),
'login_mobile'=>$param['principal_mobile']
],
... ... @@ -456,17 +457,23 @@ class SyncProject extends Command
*/
public function createUser($mobile,$project_id,$lead_name){
$userModel = new UserModel();
//查看当前用户是否存在
$info = $userModel->read(['mobile'=>$mobile,'project_id'=>$project_id]);
if($info === false){
$data = [
'mobile'=>$mobile,
'password'=>base64_encode(md5('123456')),
'project_id'=>$project_id,
'name'=>$lead_name,
'type'=>UserModel::TYPE_ONE
];
$userModel->add($data);
//查看当前项目是否存在号码库中
$mobileModel = new Mobile();
$mobileInfo = $mobileModel->read(['mobile'=>$mobile]);
if($mobileInfo === false){
//查看当前用户是否存在
$info = $userModel->read(['mobile'=>$mobile,'project_id'=>$project_id]);
if($info === false){
$data = [
'mobile'=>$mobile,
'password'=>base64_encode(md5('123456')),
'project_id'=>$project_id,
'name'=>$lead_name,
'type'=>UserModel::TYPE_ONE
];
$userModel->add($data);
}
}
return true;
}
}
... ...
... ... @@ -41,45 +41,82 @@ class HtmlCustomCollect extends Command
{
ini_set('memory_limit', '512M');
$project_id = 633;
$project_site = 'v6-ke5nz.globalso.site';
$project_id = 517;
$project_site = 'v6-1gee9.globalso.site';
$pages = [
'https://www.mach-sales.com/case_catalog/cases/',
'https://www.mach-sales.com/case_catalog/cases/page/2/',
'https://www.mach-sales.com/case_catalog/cases/page/3/',
'https://www.mach-sales.com/case/growing-with-customers-from-small-motors-to-big-drivers/',
'https://www.mach-sales.com/case/growing-together-with-customers-the-journey-of-intelligent-manufacturing-in-a-modernized-factory/',
'https://www.mach-sales.com/case/%e3%80%90growing-together-with-customers%e3%80%91-the-evolutionary-journey-of-a-baking-brand/',
'https://www.mach-sales.com/case/sumecs-footprints-in-belt-and-road-singapore/',
'https://www.mach-sales.com/case/sumecs-footprints-in-belt-and-road-southeast-asia/',
'https://www.mach-sales.com/case/naming-and-delivery-of-a-new-ship-1/',
'https://www.mach-sales.com/case/a-newly-signed-contract-cable-manufacturing-equipment/',
'https://www.mach-sales.com/case/its-amazing-that-the-glass-can-also-save-energy/',
'https://www.mach-sales.com/case/%e3%80%90grow-with-customers%e3%80%91better-service-for-papermaking-equipment-procurement/',
'https://www.mach-sales.com/case/expansion-of-blower-equipment-contributes-to-environmental-protection/',
'https://www.mach-sales.com/case/new-ship-type-new-contract/',
'https://www.mach-sales.com/case/new-arrival-introducing-the-latest-ship-model/',
'https://www.mach-sales.com/case/another-contract-signed-in-the-philippines/',
'https://www.mach-sales.com/case/the-road-to-going-global-is-supported-by-sumec-services/',
'https://www.mach-sales.com/case/sumec-textile-launches-sun-protection-series-in-collaboration-with-skechers-kids/',
'https://www.mach-sales.com/case/footwear-manufacturing-equipment-new-contract/',
'https://www.mach-sales.com/case/sumec-energy-company-has-successfully-signed-a-photovoltaic-component-supply-agreement-with-wattkraft-a-german-engineering-system-integrator/',
'https://www.mach-sales.com/case/sumec-technology-company-successfully-signed-a-contract-for-the-equipment-related-to-the-high-strength-particleboard-project/',
'https://www.mach-sales.com/case/%e3%80%90growing-together-with-our-customers%e3%80%91together-on-the-road-to-transformation/',
'https://www.mach-sales.com/case/new-signing/',
'https://www.mach-sales.com/case/complete-the-last-mile-equipment-procurement-from-around-the-world/',
'https://www.mach-sales.com/case/science-and-technology-to-rejuvenate-agriculture-this-plant-factory-is-not-simple/',
'https://www.mach-sales.com/case/new-cooperation-high-end-equipment-going-global/',
'https://www.mach-sales.com/case/a-new-cooperation-with-an-annual-output-of-40000-tons/',
'https://www.mach-sales.com/case/a-new-contract-cooperation-upgrades/',
'https://www.mach-sales.com/case/annual-output-of-50000-tons-this-bopp-film-production-line-was-officially-put-into-operation/',
'https://www.mach-sales.com/case/this-is-sumec-speed/',
'https://www.mach-sales.com/case/the-first-order-of-a-new-semiconductor-brand-equipment-direct-sales-bear-fruit-again/',
'https://www.mach-sales.com/case/sumec-touch-world-celebrates-its-5th-anniversary-with-well-known-suppliers/',
'https://www.mach-sales.com/case/from-traditional-agency-to-digital-service/',
'https://www.mach-sales.com/case/cooperation-win-win-and-starting-anew-sumec-creates-a-new-sample-of-strong-enterprise-cooperation/'
'https://www.beifa.group/help/send-results/',
'https://www.beifa.group/help/terms-of-use/',
'https://www.beifa.group/help/position-3/',
'https://www.beifa.group/help/position-2/',
'https://www.beifa.group/help/position-1/',
'https://www.beifa.group/help/social-media/',
'https://www.beifa.group/help/globle-exibition-2/',
'https://www.beifa.group/help/job/',
'https://www.beifa.group/help/vr/',
'https://www.beifa.group/help/on-live-video/',
'https://www.beifa.group/help/honor/',
'https://www.beifa.group/help/certification/',
'https://www.beifa.group/help/quanity-control/',
'https://www.beifa.group/help/testing-center/',
'https://www.beifa.group/help/rd/',
'https://www.beifa.group/help/design-trend/',
'https://www.beifa.group/help/partner/',
'https://www.beifa.group/help/social-responsibility/',
'https://www.beifa.group/help/contact/',
];
// $project_id = 586;
// $project_site = 'v6-m605x.globalso.site';
// $pages = [
// 'https://www.citymax-group.com/case/',
// 'https://www.citymax-group.com/case_catalog/crop-classification/',
// 'https://www.citymax-group.com/case_catalog/field-crops/',
// 'https://www.citymax-group.com/case_catalog/fruits/',
// 'https://www.citymax-group.com/case_catalog/vegetables/',
// 'https://www.citymax-group.com/case/report-on-use-of-citymax-products-on-grapes-2/',
// 'https://www.citymax-group.com/case/report-on-use-of-citymax-products-on-cucumber/',
// 'https://www.citymax-group.com/case/field-experiment-crop-lettuce/',
// ];
// $project_id = 633;
// $project_site = 'v6-ke5nz.globalso.site';
// $pages = [
// 'https://www.mach-sales.com/case_catalog/cases/',
// 'https://www.mach-sales.com/case_catalog/cases/page/2/',
// 'https://www.mach-sales.com/case_catalog/cases/page/3/',
// 'https://www.mach-sales.com/case/growing-with-customers-from-small-motors-to-big-drivers/',
// 'https://www.mach-sales.com/case/growing-together-with-customers-the-journey-of-intelligent-manufacturing-in-a-modernized-factory/',
// 'https://www.mach-sales.com/case/%e3%80%90growing-together-with-customers%e3%80%91-the-evolutionary-journey-of-a-baking-brand/',
// 'https://www.mach-sales.com/case/sumecs-footprints-in-belt-and-road-singapore/',
// 'https://www.mach-sales.com/case/sumecs-footprints-in-belt-and-road-southeast-asia/',
// 'https://www.mach-sales.com/case/naming-and-delivery-of-a-new-ship-1/',
// 'https://www.mach-sales.com/case/a-newly-signed-contract-cable-manufacturing-equipment/',
// 'https://www.mach-sales.com/case/its-amazing-that-the-glass-can-also-save-energy/',
// 'https://www.mach-sales.com/case/%e3%80%90grow-with-customers%e3%80%91better-service-for-papermaking-equipment-procurement/',
// 'https://www.mach-sales.com/case/expansion-of-blower-equipment-contributes-to-environmental-protection/',
// 'https://www.mach-sales.com/case/new-ship-type-new-contract/',
// 'https://www.mach-sales.com/case/new-arrival-introducing-the-latest-ship-model/',
// 'https://www.mach-sales.com/case/another-contract-signed-in-the-philippines/',
// 'https://www.mach-sales.com/case/the-road-to-going-global-is-supported-by-sumec-services/',
// 'https://www.mach-sales.com/case/sumec-textile-launches-sun-protection-series-in-collaboration-with-skechers-kids/',
// 'https://www.mach-sales.com/case/footwear-manufacturing-equipment-new-contract/',
// 'https://www.mach-sales.com/case/sumec-energy-company-has-successfully-signed-a-photovoltaic-component-supply-agreement-with-wattkraft-a-german-engineering-system-integrator/',
// 'https://www.mach-sales.com/case/sumec-technology-company-successfully-signed-a-contract-for-the-equipment-related-to-the-high-strength-particleboard-project/',
// 'https://www.mach-sales.com/case/%e3%80%90growing-together-with-our-customers%e3%80%91together-on-the-road-to-transformation/',
// 'https://www.mach-sales.com/case/new-signing/',
// 'https://www.mach-sales.com/case/complete-the-last-mile-equipment-procurement-from-around-the-world/',
// 'https://www.mach-sales.com/case/science-and-technology-to-rejuvenate-agriculture-this-plant-factory-is-not-simple/',
// 'https://www.mach-sales.com/case/new-cooperation-high-end-equipment-going-global/',
// 'https://www.mach-sales.com/case/a-new-cooperation-with-an-annual-output-of-40000-tons/',
// 'https://www.mach-sales.com/case/a-new-contract-cooperation-upgrades/',
// 'https://www.mach-sales.com/case/annual-output-of-50000-tons-this-bopp-film-production-line-was-officially-put-into-operation/',
// 'https://www.mach-sales.com/case/this-is-sumec-speed/',
// 'https://www.mach-sales.com/case/the-first-order-of-a-new-semiconductor-brand-equipment-direct-sales-bear-fruit-again/',
// 'https://www.mach-sales.com/case/sumec-touch-world-celebrates-its-5th-anniversary-with-well-known-suppliers/',
// 'https://www.mach-sales.com/case/from-traditional-agency-to-digital-service/',
// 'https://www.mach-sales.com/case/cooperation-win-win-and-starting-anew-sumec-creates-a-new-sample-of-strong-enterprise-cooperation/'
// ];
// $project_id = 437;
// $project_site = 'v6-1500k.globalso.site';
// $pages = [
... ...
... ... @@ -40,7 +40,7 @@ class ProjectReset extends Command
//关闭数据库
DB::disconnect('custom_mysql');
UpdateLog::where('project_id', $project_id)->whereIn('api_type', ['post', 'page', 'news', 'blog'])->update(['collect_status' => 0]);
UpdateLog::where('project_id', $project_id)->whereIn('api_type', ['post', 'page', 'news', 'blog'])->update(['status' => 0, 'collect_status' => 0]);
echo $project_id . ',重置成功' . PHP_EOL;
}
... ...
... ... @@ -331,7 +331,7 @@ class ProjectUpdate extends Command
$category_id = '';
if ($api_type == 'news' && ($item['category'] ?? [])) {
$category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]);
$category_id = $logic->getLastCategory(array_column($category_arr, 'id'));
$category_id = $logic->getCategory(array_column($category_arr, 'id'));
}
try {
$item['ttile'] = $this->special2str($item['ttile'] ?? '');
... ...
... ... @@ -40,6 +40,7 @@ class Kernel extends ConsoleKernel
$schedule->command('update_seo_tdk_crontab')->dailyAt('00:00')->withoutOverlapping(1); //更新上线项目TDK
$schedule->command('website_data')->dailyAt('01:00')->withoutOverlapping(1); // 向AICC推送数据
$schedule->command('project_file_pdf')->dailyAt('00:00')->withoutOverlapping(1); // 网站项目数据,生成PDF文件
$schedule->command('sync_manager')->dailyAt('01:00')->withoutOverlapping(1); //TODO::手机号码同步 每天执行一次
}
/**
... ...
... ... @@ -74,7 +74,7 @@ class Handler extends ExceptionHandler
}
//验证错误(非手动抛出)
elseif ($exception instanceof ValidationException) {
LogUtils::error("参数验证失败", [], $exceptionMessage);
// LogUtils::error("参数验证失败", [], $exceptionMessage);
}
//Redis错误(非手动抛出)
elseif ($exception instanceof \RedisException) {
... ...
... ... @@ -8,9 +8,8 @@ use App\Utils\LogUtils;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Carbon;
use App\Models\File\File;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Redis;
use App\Models\User\User;
define('HTTP_OPENAI_URL', 'http://openai.waimaoq.com/');
/**
... ... @@ -24,7 +23,8 @@ define('HTTP_OPENAI_URL', 'http://openai.waimaoq.com/');
if (!function_exists('generateRoute')) {
function generateRoute($string)
{
return trim(strtolower(preg_replace('/[\W]+/', '-', trim($string))), '-');
//TODO::html结尾,htm结尾,只处理.htm前面的内容
return trim(strtolower(preg_replace('/[^\w.]+/', '-', trim($string))), '-');
}
}
... ... @@ -460,7 +460,6 @@ if (!function_exists('getImageUrl')) {
foreach ($path as $v){
$url[] = getImageUrl($v);
}
$url = array_filter($url);
}else{
if(empty($path)){
return '';
... ...
... ... @@ -31,7 +31,7 @@ class CreateKeywordController extends BaseController
* @time :2023/12/19 9:31
*/
public function lists(CreateKeyword $createKeyword){
$list = $createKeyword->list($this->map);
$list = $createKeyword->list($this->map,'id',['*'],'asc');
$this->response('success',Code::SUCCESS,$list);
}
... ...
... ... @@ -37,7 +37,8 @@ class OptimizeController extends BaseController
->leftJoin('gl_project_deploy_build', 'gl_project.id', '=', 'gl_project_deploy_build.project_id')
->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')
->leftJoin('gl_project_online_check', 'gl_project.id', '=', 'gl_project_online_check.project_id');
$query = $this->searchParam($query)->orderByRaw('CASE WHEN gl_project_deploy_optimize.start_date IS NULL THEN 0 ELSE 1 END')
$query = $this->searchParam($query)->orderByRaw("FIELD(gl_project.level, '2') DESC")
->orderByRaw('CASE WHEN gl_project_deploy_optimize.start_date IS NULL THEN 0 ELSE 1 END')
->orderBy('gl_project_deploy_optimize.start_date','desc');
$lists = $query->paginate($this->row, $this->selectParam(), 'page', $this->page)->toArray();
if(!empty($lists) && !empty($lists['list'])){
... ... @@ -187,6 +188,7 @@ class OptimizeController extends BaseController
$query = $query->where('gl_project_deploy_build.test_domain','like','%'.$this->map['test_domain'].'%');
}
$query = $query->whereIn('gl_project.type',[2,4]);//TODO::2,4代表优化项目
$query = $query->where('gl_project_online_check.qa_status',1);
return $query;
}
... ...
... ... @@ -124,8 +124,6 @@ class ProjectController extends BaseController
public function searchUpgrade(&$query){
if(isset($this->map['is_upgrade'])){
$query->where('gl_project.is_upgrade', $this->map['is_upgrade']);
}else{
$query->where('gl_project.is_upgrade', 0);
}
return $query;
}
... ... @@ -352,9 +350,8 @@ class ProjectController extends BaseController
* @method :post
* @time :2023/8/17 16:42
*/
public function save(ProjectRequest $request, ProjectLogic $logic)
public function save(ProjectLogic $logic)
{
$request->validated();
$logic->projectSave();
$this->response('success');
}
... ...
... ... @@ -55,6 +55,7 @@ class BlogController extends BaseController
$query = $query->where('project_id',$this->user['project_id']);
if (isset($this->map['category_id']) && !empty($this->map['category_id'])) {
$str = [];
$str[] = $this->map['category_id'];
$this->getAllSub($this->map['category_id'],$str);
$query->where(function ($subQuery) use ($str) {
foreach ($str as $v) {
... ... @@ -83,7 +84,7 @@ class BlogController extends BaseController
*/
public function getAllSub($id,&$str = []){
$cateModel = new BlogCategory();
$list = $cateModel->list(['pid'=>$id,'status'=>1],['id','pid']);
$list = $cateModel->list(['pid'=>$id,'status'=>0],['id','pid']);
if(!empty($list)){
foreach ($list as $v){
$str[] = $v['id'];
... ...
... ... @@ -90,13 +90,13 @@ class CustomModuleExtentController extends BaseController
* @method :post
* @time :2023/12/21 9:25
*/
public function extendContent(CustomModuleExtentContent $content){
public function extendContent(CustomModuleExtend $extend){
$this->request->validate([
'module_id'=>['required'],
],[
'module_id.required' => 'module_id不能为空',
]);
$lists = $content->list($this->map);
$lists = $extend->list($this->map,'created_at');
$this->response('success',Code::SUCCESS,$lists);
}
... ...
<?php
/**
* @remark :
* @name :ProjectKeywordController.php
* @author :lyh
* @method :post
* @time :2023/12/26 9:22
*/
namespace App\Http\Controllers\Bside\Keyword;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Models\Project\DeployOptimize;
class ProjectKeywordController extends BaseController
{
/**
* @remark :获取搜索关键词
* @name :searchKeywords
* @author :lyh
* @method :post
* @time :2023/12/26 10:07
*/
public function searchKeywords(DeployOptimize $deployOptimize){
$data = [];
$info = $deployOptimize->read(['project_id'=>$this->user['project_id']]);
if($info === false){
$this->response('success');
}
$data['search_keywords'] = $info['search_keywords'];
$data['customer_keywords'] = $info['customer_keywords'];
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -215,9 +215,11 @@ class NavController extends BaseController
*/
public function setSortList(NavLogic $navLogic){
$this->request->validate([
'id'=>'required'
'id'=>'required',
'sort_list'=>'required',
],[
'id.required' => 'ID不能为空',
'sort_list.required' => '排序不能为空',
]);
$navLogic->setSortList();
$this->response('success');
... ...
... ... @@ -9,6 +9,8 @@ use App\Http\Requests\Bside\News\NewsRequest;
use App\Models\News\News as NewsModel;
use App\Models\News\NewsCategory;
use App\Models\RouteMap\RouteMap;
use App\Models\Template\BTemplate;
use App\Models\Template\Setting;
use App\Models\User\User;
... ... @@ -33,19 +35,45 @@ class NewsController extends BaseController
$lists = $lists->toArray();
// //获取当前项目的所有分类
$data = $this->getCategoryList();
//获取当前用户选择的模版
$templateSettingModel = new Setting();
$info = $templateSettingModel->read(['project_id'=>$this->user['project_id']]);
$user = new User();
foreach ($lists['list'] as $k => $v){
$v['category_name'] = $this->categoryName($v['category_id'],$data);
$v['url'] = $this->user['domain'].getRouteMap(RouteMap::SOURCE_NEWS,$v['id']);
$v['image_link'] = getImageUrl($v['image']);
$v['operator_name'] = $user->getName($v['operator_id']);
$v['is_renovation'] = $this->getProductIsRenovation($info,$v['id']);
$lists['list'][$k] = $v;
}
}
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :查看产品是否已装修
* @name :getProductIsRenovation
* @author :lyh
* @method :post
* @time :2023/9/13 14:02
*/
public function getProductIsRenovation($info,$id){
if($info !== false){
$webTemplateModel = new BTemplate();
$param = [
'source'=>4,
'project_id'=>$this->user['project_id'],
'source_id'=>$id,
'template_id'=>$info['template_id']
];
$templateInfo = $webTemplateModel->read($param);
if($templateInfo !== false){
return 1;
}
}
return 0;
}
/**
* @remark :处理列表返回参数
... ... @@ -58,7 +86,9 @@ class NewsController extends BaseController
$query = $query->where('project_id',$this->user['project_id']);
if (isset($this->map['category_id']) && !empty($this->map['category_id'])) {
$str = [];
$str[] = $this->map['category_id'];
$this->getAllSub($this->map['category_id'],$str);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($str, true) . PHP_EOL, FILE_APPEND);
$query->where(function ($subQuery) use ($str) {
foreach ($str as $v) {
$subQuery->orWhereRaw("FIND_IN_SET(?, category_id) > 0", [$v]);
... ... @@ -86,7 +116,7 @@ class NewsController extends BaseController
*/
public function getAllSub($id,&$str = []){
$cateModel = new NewsCategory();
$list = $cateModel->list(['pid'=>$id,'status'=>1],['id','pid']);
$list = $cateModel->list(['pid'=>$id,'status'=>0],['id','pid']);
if(!empty($list)){
foreach ($list as $v){
$str[] = $v['id'];
... ...
... ... @@ -62,7 +62,6 @@ class CategoryController extends BaseController
if(!empty($this->map['title'])){
$this->map['title'] = ['like','%'.$this->map['title'].'%'];
}
$this->map['project_id'] = $this->user['project_id'];
return $this->map;
}
... ...
... ... @@ -79,6 +79,7 @@ class ProductController extends BaseController
$query = $query->where('project_id',$this->user['project_id']);
if (isset($this->map['category_id']) && !empty($this->map['category_id'])) {
$str = [];
$str[] = $this->map['category_id'];
$this->getAllSub($this->map['category_id'],$str);
$query->where(function ($subQuery) use ($str) {
foreach ($str as $v) {
... ...
... ... @@ -134,6 +134,12 @@ class LoginLogic extends BaseLogic
}
//获取超级管理员登录
if(isset($this->param['project_id']) && !empty($this->param['project_id'])){
//查看当前项目是否有超级管理员
$userModel = new User();
$userinfo = $userModel->read(['project_id'=>$this->param['project_id'],'role_id'=>0]);
if($userinfo === false){
$this->fail('未添加超级管理员账号,请添加后在进入账号.');
}
$data['autologin_code'] = $encrypt->lock_url(json_encode(['project_id'=>$this->param['project_id'],'manager_id'=>$this->manager['id']]),$info['values']);
}
//使用用户登录
... ...
... ... @@ -30,14 +30,30 @@ class KeywordPrefixLogic extends BaseLogic
* @time :2023/9/6 14:42
*/
public function prefixSave(){
try {
if(isset($this->param['id']) && !empty($this->param['id'])){
$this->model->edit($this->param,['id'=>$this->param['id']]);
}else{
$this->model->add($this->param);
if(isset($this->param['id']) && !empty($this->param['id'])){
$condition = [
'keyword'=>$this->param['keyword'],
'id'=>['!=',$this->param['id']]
];
$prefixInfo = $this->model->read($condition);
if($prefixInfo !== false){
$this->fail('当前关键字已存在');
}
}catch (\Exception $e){
$this->fail('error');
$data = [
'keyword'=>$this->param['keyword']
];
$this->model->edit($data,['id'=>$this->param['id']]);
}else{
$data = [
'project_id'=>$this->param['project_id'] ?? 0,
'keyword'=>$this->param['keyword'],
'type'=>$this->param['type']
];
$prefixInfo = $this->model->read($data);
if($prefixInfo !== false){
$this->fail('当前关键字已存在');
}
$this->model->add($data);
}
return $this->success();
}
... ...
... ... @@ -73,6 +73,7 @@ class ProjectLogic extends BaseLogic
if($info['extend_type'] != 0){
$info['type'] = $info['extend_type'];
}
$info['domain_url'] = (new DomainInfo())->getDomain($info['deploy_optimize']['domain'] ?? 0);
//升级项目初始上传配置
if(empty($info['upload_config'])){
$info['upload_config'] =["upload_max_num"=>100, "allow_file_type"=>"doc,docx,xls,xlsx,pdf,txt,csv,png,jpg,jpeg", "upload_max_size"=>5];
... ... @@ -143,7 +144,7 @@ class ProjectLogic extends BaseLogic
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('请填写完整后再提交');
$this->fail('保存失败,请联系管理员');
}
(new SyncService())->projectAcceptAddress($this->param['id']);
return $this->success();
... ... @@ -174,8 +175,6 @@ class ProjectLogic extends BaseLogic
}
}
$param['notice_file'] = Arr::a2s($param['notice_file']);
}else{
unset($param['notice_file']);
}
if(isset($param['confirm_file']) && !empty($param['confirm_file'])){
foreach ($param['confirm_file'] as &$v2) {
... ... @@ -184,11 +183,10 @@ class ProjectLogic extends BaseLogic
}
}
$param['confirm_file'] = Arr::a2s($param['confirm_file']);
}else{
unset($param['confirm_file']);
}
$param['remain_day'] = $param['deploy_build']['service_duration'] - $param['finish_remain_day'];
$param['remain_day'] = ($param['remain_day'] > 0) ? $param['remain_day'] : 0;
unset($param['payment'],$param['deploy_build'],$param['deploy_optimize'],$param['online_check'],$param['project_after']);
//文件上传默认值
if($param['is_upload_manage']){
$param['upload_config'] = [
... ... @@ -382,8 +380,8 @@ class ProjectLogic extends BaseLogic
*/
public function createUser($mobile,$project_id,$lead_name){
$userModel = new UserModel();
//查看当前用户是否存在
$info = $userModel->read(['mobile'=>$mobile,'project_id'=>$project_id]);
//查看当前项目是否存在超级管理员
$info = $userModel->read(['role_id'=>0,'project_id'=>$project_id]);
if($info === false){
$data = [
'mobile'=>$mobile,
... ... @@ -395,6 +393,8 @@ class ProjectLogic extends BaseLogic
'create_id'=>$this->manager['id'] ?? 0,
];
$userModel->add($data);
}else{
$userModel->edit(['mobile'=>$mobile,'name'=>$lead_name],['id'=>$info['id']]);
}
return $this->success();
}
... ...
... ... @@ -6,6 +6,7 @@ use App\Helper\Common;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Manage\Manage;
use App\Models\Manage\MenuSpecial;
use App\Models\Manage\Mobile;
use App\Models\Project\Project;
use App\Models\User\ProjectRole;
use App\Models\User\User;
... ... @@ -54,6 +55,9 @@ class UserLogic extends BaseLogic
$this->param = $this->editPassword($this->param);
$rs = $this->model->edit($this->param, ['id' => $this->param['id']]);
} else {
$mobileModel = new Mobile();
//查看当前手机号码是否存在于手机号码库
$mobileInfo = $mobileModel->read(['mobile'=>$this->param['mobile']]);
$this->param['password'] = base64_encode(md5($this->param['password']));
$rs = $this->model->add($this->param);
}
... ... @@ -104,7 +108,6 @@ class UserLogic extends BaseLogic
if($param['role_id'] == $this->model::ROLE_MANAGER){
if(isset($param['id']) && !empty($param['id'])){
$condition = [
'mobile' => $param['mobile'],
'project_id'=>$param['project_id'],
'id' => ['!=', $param['id']],
'role_id'=>$this->model::ROLE_MANAGER
... ... @@ -149,16 +152,19 @@ class UserLogic extends BaseLogic
public function user_del()
{
foreach ($this->param['id'] as $id){
$info = $this->model->read(['id'=>$id],['id','role_id']);
if($info['role_id'] != 0){
$rs = $this->model->del(['id'=>$id]);
if($rs === false){
$this->fail('系统错误,请联系管理员');
$info = $this->model->read(['id'=>$id],['id','role_id','project_id']);
if($info['role_id'] == 0) {
//查看当前项目是否有其他的超级管理员
$roleInfo = $this->model->read(['id' => ['!=', $id], 'role_id' => 0,'project_id'=>$info['project_id']]);
if ($roleInfo === false) {
$this->fail('唯一超级管理员,禁止删除');
}
Common::del_user_cache($this->model, $id, 'A');
}else{
$this->fail('超级管理员不允许删除');
}
$rs = $this->model->del(['id' => $id]);
if ($rs === false) {
$this->fail('系统错误,请联系管理员');
}
Common::del_user_cache($this->model, $id, 'A');
}
return $this->success();
}
... ... @@ -192,7 +198,7 @@ class UserLogic extends BaseLogic
$roleInfo = $roleModel->where('project_id',$this->param['project_id'])->orderBy('id','asc')->first();
$info = $this->model->read(['role_id'=>0]);
if(empty($info) || empty($roleInfo)){
$this->fail('系统错误,请联系管理员');
$this->fail('请先添加角色');
}
try {
$this->model->edit(['role_id'=>$roleInfo['id']],['id'=>$info['id']]);
... ...
... ... @@ -89,7 +89,7 @@ class BTemplateLogic extends BaseLogic
$type = $this->getCustomizedType($source, $source_id);//定制获取头部底部类型
$commonInfo = $this->getCommonPage($type,$this->user['project_id'],0);//获取定制头部
$html = $this->handleAllHtml($commonInfo,$templateInfo['html']);
return $this->success(['html'=>$html,'template_id'=>$template_id,'id'=>$templateInfo['id']]);
return $this->success(['html'=>$html,'template_id'=>$template_id,'id'=>$templateInfo['id'],'updated_at'=>$templateInfo['updated_at']]);
}
$mainInfo = ['main_html'=>$templateInfo['main_html'], 'main_css'=>$templateInfo['main_css']];
}
... ... @@ -98,7 +98,10 @@ class BTemplateLogic extends BaseLogic
$commonInfo['head_html'].$mainInfo['main_html'].$commonInfo['footer_html'];
$html = $this->getHeadFooter($html);
$result = ['html'=>$html,'template_id'=>$template_id];
if($templateInfo !== false){$result['id'] = $templateInfo['id'];}
if($templateInfo !== false){
$result['id'] = $templateInfo['id'];
$result['updated_at'] = $templateInfo['updated_at'];
}
return $this->success($result);
}
... ... @@ -661,14 +664,6 @@ class BTemplateLogic extends BaseLogic
return $this->success($list);
}
/**
* @remark :获取类型
* @name :getModuleType
* @author :lyh
* @method :any
* @time :2023/7/17 16:03
*/
/**
* @remark :获取类型
* @name :getModuleType
... ... @@ -695,6 +690,13 @@ class BTemplateLogic extends BaseLogic
return $this->success($data);
}
/**
* @remark :获取类型
* @name :getModuleTypes
* @author :lyh
* @method :post
* @time :2023/12/26 14:18
*/
public function getModuleTypes(){
$data['module'] = ['默认','产品','新闻','博客','产品分类'];
$data = [
... ... @@ -709,7 +711,7 @@ class BTemplateLogic extends BaseLogic
$moduleModel = new CustomModule();
$moduleList = $moduleModel->list(['status'=>0]);
foreach ($moduleList as $v){
$moduleCategory = $this->getCategoryList((new CustomModuleCategory()),0,['id','name','pid']);
$moduleCategory = $this->getCategoryModuleList((new CustomModuleCategory()),$v['id'],0,['id','name','pid']);
$categoryList = [["id"=>"all", "name"=>"全部"], ["id"=>"new", "name"=>"最新"]];
foreach ($moduleCategory as $values){
$categoryList[] = $values;
... ... @@ -782,6 +784,26 @@ class BTemplateLogic extends BaseLogic
}
/**
* @remark :获取1级+2级
* @name :getCategoryList
* @author :lyh
* @method :post
* @time :2023/12/20 10:26
*/
public function getCategoryModuleList($categoryModel,$module_id,$status = 0,$filed = ['*']){
$data = array();
$list = $categoryModel->list(['pid'=>0, 'module_id'=>$module_id , 'status'=>$status],['sort','id'],$filed);
foreach ($list as $v){
$data[] = $v;
$son_list = $categoryModel->list(['pid'=>$v['id'],'module_id'=>$module_id,'status'=>$status],['sort','id'],$filed);
foreach ($son_list as $v1){
$data[] = $v1;
}
}
return $this->success($data);
}
/**
* @remark :保存html
* @name :savePublicTemplateHtml
* @author :lyh
... ... @@ -819,8 +841,11 @@ class BTemplateLogic extends BaseLogic
$commonInfo = $this->getTypeCommonHtml($bSettingInfo['template_id'],$this->param['type'],$is_custom);
//获取设置的默认中间部分
$bTemplateMainModel = new BTemplateMain();
$mainInfo = $bTemplateMainModel->read(['project_id'=>$this->user['project_id'],'type'=>$this->param['type']]);
$mainInfo = $bTemplateMainModel->read(['project_id'=>$this->user['project_id'],'type'=>$this->param['type'],'is_custom'=>$is_custom]);
if($mainInfo === false){
if($is_custom == BTemplate::SOURCE_CUSTOM) {
$this->param['type'] = BTemplate::TYPE_CUSTOM_DETAIL;
}
$main_html = $this->getModule($this->param['type']);
$main_style = "<style id='globalsojs-styles'></style>";
}else{
... ...
... ... @@ -63,23 +63,22 @@ class CustomTemplateLogic extends BaseLogic
* @time :2023/6/29 16:21
*/
public function customTemplateSave(){
try {
$this->param['url'] = str_replace_url($this->param['url']);
if(isset($this->param['id']) && !empty($this->param['id'])){
$this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $this->param['id'], $this->user['project_id']);
$this->editCustomRoute($this->param['url']);
$this->model->edit($this->param,['id'=>$this->param['id']]);
}else{
if($this->param['url'] == $this->model::NOT_FOUND_PAGE_URL){
$this->fail('404页面已存在');
}
$this->param['project_id'] = $this->user['project_id'];
$id = $this->model->addReturnId($this->param);
$route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']);
$this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route);
$this->model->edit(['url'=>$route],['id'=>$id]);
$this->param['url'] = str_replace_url($this->param['url']);
if(isset($this->param['id']) && !empty($this->param['id'])){
$this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $this->param['id'], $this->user['project_id']);
$this->editCustomRoute($this->param['url']);
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
}else{
if($this->param['url'] == $this->model::NOT_FOUND_PAGE_URL){
$this->fail('404页面已存在');
}
}catch (\Exception $e){
$this->param['project_id'] = $this->user['project_id'];
$id = $this->model->addReturnId($this->param);
$route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']);
$this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route);
$rs = $this->model->edit(['url'=>$route],['id'=>$id]);
}
if($rs === false){
$this->fail('保存失败,请联系管理员');
}
return $this->success();
... ... @@ -95,6 +94,9 @@ class CustomTemplateLogic extends BaseLogic
public function saveHtml(){
$html = $this->param['html'];
$info = $this->model->read(['id'=>$this->param['id']],['id','is_visualization','url']);
if($info === false){
$this->fail('当前数据不存在或已被删除');
}
if($info['is_visualization'] == 0 || $info['is_visualization'] == 1){//非定制项目+可视化页面
//获取设置的默认模版
$bSettingModel = new Setting();
... ... @@ -208,13 +210,13 @@ class CustomTemplateLogic extends BaseLogic
*/
public function editCustomRoute($route){
$info = $this->model->read(['id'=>$this->param['id']]);
if($info['url'] == $this->model::NOT_FOUND_PAGE_URL && $route['url'] != '404'){
$this->fail('404页面链接不可修改');
}
if($info['url'] != $route){
$this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route);
$this->curlDelRoute(['route'=>$info['url'],'new_route'=>$route]);
if($info['url'] == $this->model::NOT_FOUND_PAGE_URL){
if($route != '404'){
$this->fail('不可删除, 只可以修改tdk');
}
}
$this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route);
$this->curlDelRoute(['route'=>$info['url'],'new_route'=>$route]);
return true;
}
... ...
... ... @@ -38,6 +38,7 @@ class BlogLogic extends BaseLogic
$route = $this->param['url'];
$this->edit($this->param,['id'=>$this->param['id']]);
}else{
$this->param['sort'] = $this->setNewsSort();
$id = $this->model->addReturnId($this->param);
$route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']);
$this->edit(['url'=>$route],['id'=>$id]);
... ... @@ -53,6 +54,22 @@ class BlogLogic extends BaseLogic
}
/**
* @remark :设置最新产品的sort排序
* @name :setNewsSort
* @author :lyh
* @method :post
* @time :2023/12/25 9:27
*/
public function setNewsSort(){
$info = $this->model->orderBy('sort','desc')->first();
if(empty($info)){
return 1;
}
$sort = $info['sort']+1;
return $sort;
}
/**
* @name :编辑seo
* @return void
* @author :liyuhang
... ... @@ -153,14 +170,14 @@ class BlogLogic extends BaseLogic
if(isset($this->param['id'])){
$param['operator_id'] = $this->user['id'];
if(isset($param['category_id']) && !empty($param['category_id'])){
$param['category_id'] = $this->getLastCategory($param['category_id']);
$param['category_id'] = $this->getCategory($param['category_id']);
}
}else{
$param['create_id'] = $this->user['id'];
$param['operator_id'] = $this->user['id'];
$param['project_id'] = $this->user['project_id'];
if(isset($param['category_id']) && !empty($param['category_id'])){
$param['category_id'] = $this->getLastCategory($param['category_id']);
$param['category_id'] = $this->getCategory($param['category_id']);
}
}
return $this->success($param);
... ... @@ -173,16 +190,12 @@ class BlogLogic extends BaseLogic
* @method :post
* @time :2023/10/20 9:02
*/
public function getLastCategory($category){
public function getCategory($category){
$str = '';
$cateModel = new BlogCategoryModel();
foreach ($category as $v){
$info = $cateModel->read(['pid'=>$v]);
if($info === false){
$str .= $v.',';
}
}
return ','.$str;
return !empty($str) ? ','.$str : '';
}
/**
... ...
... ... @@ -149,6 +149,7 @@ class CustomModuleContentLogic extends BaseLogic
*/
public function contentAdd(){
try {
$this->param['sort'] = $this->setNewsSort();
$id = $this->model->addReturnId($this->param);
$route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_MODULE,
$id, $this->user['project_id']);
... ... @@ -162,6 +163,22 @@ class CustomModuleContentLogic extends BaseLogic
}
/**
* @remark :设置最新产品的sort排序
* @name :setNewsSort
* @author :lyh
* @method :post
* @time :2023/12/25 9:27
*/
public function setNewsSort(){
$info = $this->model->orderBy('sort','desc')->first();
if(empty($info)){
return 1;
}
$sort = $info['sort']+1;
return $sort;
}
/**
* @remark :编辑数据
* @name :contentEdit
* @author :lyh
... ... @@ -281,6 +298,7 @@ class CustomModuleContentLogic extends BaseLogic
}
$v['project_id'] = $this->user['project_id'];
$v['content_id'] = $content_id;
$v['module_id'] = $content_id;
return $this->success($v);
}
... ...
... ... @@ -30,7 +30,7 @@ class ImportLogic extends BaseLogic
$this->fail('导入文件格式必须为csv');
}
$domain = $this->param['domain'];
if (strpos($domain, 'https') === false || strpos($domain, 'http') == false) {
if (strpos($domain, 'https') === false && strpos($domain, 'http') == false) {
$this->fail('请输入完整的采集页面地址');
}
$domain_arr = parse_url($domain);
... ... @@ -41,7 +41,6 @@ class ImportLogic extends BaseLogic
$this->param['domain'] = $domain_arr['host'];
$this->param['project_id'] = $this->user['project_id'];
$this->param['user_id'] = $this->user['id'];
$this->param['status'] = 9;
$rs = $this->model->add($this->param);
if ($rs === false) {
$this->fail('error');
... ...
... ... @@ -122,6 +122,7 @@ class NavLogic extends BaseLogic
'target'=>$param['target'] ?? 1,
'remark'=>$param['remark'] ?? '',
'group_id'=>$param['group_id'],
'show'=>$param['show'] ?? 0,
];
return $this->success($data);
}
... ... @@ -265,8 +266,4 @@ class NavLogic extends BaseLogic
$navGroupModel->edit(['sort_list'=>$this->param['sort_list']],['id'=>$this->param['id']]);
return $this->success();
}
}
... ...
... ... @@ -68,6 +68,7 @@ class NewsLogic extends BaseLogic
$route = $this->param['url'];
$this->edit($this->param, ['id' => $this->param['id']]);
} else {
$this->param['sort'] = $this->setNewsSort();
$id = $this->model->addReturnId($this->param);
$route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']);
$this->edit(['url' => $route], ['id' => $id]);
... ... @@ -84,6 +85,22 @@ class NewsLogic extends BaseLogic
}
/**
* @remark :设置最新产品的sort排序
* @name :setNewsSort
* @author :lyh
* @method :post
* @time :2023/12/25 9:27
*/
public function setNewsSort(){
$info = $this->model->orderBy('sort','desc')->first();
if(empty($info)){
return 1;
}
$sort = $info['sort']+1;
return $sort;
}
/**
* @name :编辑seo
* @return void
* @author :liyuhang
... ...
... ... @@ -99,6 +99,7 @@ class CategoryLogic extends BaseLogic
$info = $this->model->read(['id'=>$id]);
$info['url'] = $info['route'];
$info['image_link'] = getImageUrl($info['image']);
$info['describe_image'] = !empty($info['describe_image']) ? getImageUrl(json_decode($info['describe_image'])) : [];
return $this->success($info);
}
... ... @@ -112,6 +113,7 @@ class CategoryLogic extends BaseLogic
public function categorySave(){
DB::beginTransaction();
try {
$this->param = $this->saveHandleParam($this->param);
if(isset($this->param['id']) && !empty($this->param['id'])){
$this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $this->param['id'], $this->user['project_id']);
$route = $this->param['route'];
... ... @@ -135,6 +137,24 @@ class CategoryLogic extends BaseLogic
}
/**
* @remark :保存时处理数据
* @name :saveHandleParam
* @author :lyh
* @method :post
* @time :2023/12/22 17:28
*/
public function saveHandleParam($param){
if(isset($this->param['describe_image']) && !empty($this->param['describe_image'])){
foreach ($this->param['describe_image'] as $k => $v){
$v = str_replace_url($v);
$this->param['describe_image'][$k] = $v;
}
$this->param['describe_image'] = json_encode($this->param['describe_image']);
}
return $this->success($param);
}
/**
* @remark :删除
* @name :delete
* @author :lyh
... ...
... ... @@ -41,7 +41,6 @@ class KeywordLogic extends BaseLogic
$info = $this->model->read($this->param);
$info['url'] = $this->user['domain'] . $info['route'];
$info['related_news_info'] = News::whereIn('id', $info['related_news_ids'])->select(['id', 'name'])->get();
return $this->success($info);
}
... ... @@ -53,27 +52,27 @@ class KeywordLogic extends BaseLogic
* @time :2023/8/23 16:50
*/
public function keywordSave(){
DB::beginTransaction();
try {
$this->param = $this->handleSaveParam($this->param);
if(isset($this->param['id']) && !empty($this->param['id'])){
//TODO::不能修改路由
$this->model->edit($this->param,['id'=>$this->param['id']]);
$route = RouteMap::getRoute(RouteMap::SOURCE_PRODUCT_KEYWORD,$this->param['id'], $this->user['project_id']);
}else{
$this->param = $this->addHandleParam($this->param);
$id = $this->model->insertGetId($this->param);
//路由映射
$route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
$this->model->edit(['route'=>$route],['id'=>$id]);
$this->param = $this->handleSaveParam($this->param);
if(isset($this->param['id']) && !empty($this->param['id'])){
$info = $this->model->read(['title'=>$this->param['title'],'id'=>['!=',$this->param['id']]]);
if($info !== false){
$this->fail('当前title已存在');
}
// //清除缓存
Common::del_user_cache('product_keyword',$this->user['project_id']);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('保存失败');
//TODO::不能修改路由
$this->model->edit($this->param,['id'=>$this->param['id']]);
$route = RouteMap::getRoute(RouteMap::SOURCE_PRODUCT_KEYWORD,$this->param['id'], $this->user['project_id']);
}else{
$info = $this->model->read(['title'=>$this->param['title']]);
if($info !== false){
$this->fail('当前title已存在');
}
$this->param = $this->addHandleParam($this->param);
$id = $this->model->insertGetId($this->param);
//路由映射
$route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
$this->model->edit(['route'=>$route],['id'=>$id]);
}
Common::del_user_cache('product_keyword',$this->user['project_id']);
$this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_KEYWORD,$route);
$this->curlDelRoute(['new_route'=>$route]);
return $this->success();
... ...
... ... @@ -52,6 +52,7 @@ class ProductLogic extends BaseLogic
$id = $this->param['id'];
}else{
$this->param = $this->addHandleParam($this->param);
$this->param['sort'] = $this->setNewsSort();
$id = $this->model->addReturnId($this->param);
$route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']);
$this->model->edit(['route'=>$route],['id'=>$id]);
... ... @@ -69,6 +70,22 @@ class ProductLogic extends BaseLogic
}
/**
* @remark :设置最新产品的sort排序
* @name :setNewsSort
* @author :lyh
* @method :post
* @time :2023/12/25 9:27
*/
public function setNewsSort(){
$info = $this->model->orderBy('sort','desc')->first();
if(empty($info)){
return 1;
}
$sort = $info['sort']+1;
return $sort;
}
/**
* @remark :处理扩展字段
* @name :handleExtent
* @author :lyh
... ...
... ... @@ -464,9 +464,9 @@ class RankDataLogic extends BaseLogic
if($keyword_num && $type == Project::TYPE_TWO && $first_page_num >= $keyword_num){
$model->compliance_day = $model->compliance_day + 1;
$model->is_compliance = 1;
//项目表更新
Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $model->compliance_day]);
$compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0;
Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day+1]);
}
}
... ...
... ... @@ -171,6 +171,7 @@ class UserLoginLogic
$info['image_max'] = $project['image_max'];
$info['is_update_language'] = $project['is_update_language'];
$info['configuration'] = $project['deploy_build']['configuration'];
$info['project_type'] = $project['type'];
if($info['is_customized'] == 1){
$info['is_visualization'] = json_decode($project['is_visualization']);
}
... ... @@ -207,7 +208,7 @@ class UserLoginLogic
$info['image_max'] = $project['image_max'];
$info['is_update_language'] = $project['is_update_language'];
$info['configuration'] = $project['deploy_build']['configuration'];
$info['type'] = $project['type'];
$info['project_type'] = $project['type'];
if($info['is_customized'] == 1){
$info['is_visualization'] = json_decode($project['is_visualization']);
}
... ...
... ... @@ -24,7 +24,8 @@ class BlogRequest extends FormRequest
public function rules()
{
return [
'name'=>'required|max:100',
'name'=>'required|max:200',
// 'remark'=>'max:500',
'url'=>'required',
];
}
... ... @@ -33,7 +34,9 @@ class BlogRequest extends FormRequest
{
return [
'name.required'=>'请填写名称',
'url.required'=>'链接不能为空'
'name.max'=>'名称超过最长长度200',
'url.required'=>'链接不能为空',
// 'remark.max'=>'描述超过最长长度500'
];
}
}
... ...
... ... @@ -25,6 +25,7 @@ class NewsRequest extends FormRequest
{
return [
'name'=>'required|max:200',
// 'remark'=>'max:500',
'url'=>'required',
];
}
... ... @@ -33,8 +34,9 @@ class NewsRequest extends FormRequest
{
return [
'name.required'=>'请填写名称',
'name.max'=>'名称最大200字',
'url.required'=>'新闻链接不能为空'
'name.max'=>'名称超过最长长度200',
'url.required'=>'链接不能为空',
// 'remark.max'=>'描述超过最长长度500'
];
}
}
... ...
<?php
/**
* @remark :
* @name :Mobile.php
* @author :lyh
* @method :post
* @time :2023/12/25 15:41
*/
namespace App\Models\Manage;
use App\Models\Base;
class Mobile extends Base
{
protected $table = 'gl_mobile';
}
... ...
... ... @@ -355,7 +355,7 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/read', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'read'])->name('custom_read');
Route::any('/save', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'save'])->name('custom_save');
Route::any('/saveHtml', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'saveHtml'])->name('custom_saveHtml');
Route::any('/statusNum', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'statusNumber'])->name('product_statusNum');
Route::any('/statusNum', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'statusNumber'])->name('custom_statusNum');
Route::any('/del', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'del'])->name('custom_del');
});
// 菜单组
... ... @@ -427,7 +427,10 @@ Route::middleware(['bloginauth'])->group(function () {
Route::prefix('language')->group(function () {
Route::any('/', [\App\Http\Controllers\Bside\Setting\LanguageController::class, 'lists'])->name('language_lists');
});
//优化关键词,检索关键词
Route::prefix('project_keyword')->group(function () {
Route::any('/', [\App\Http\Controllers\Bside\Keyword\ProjectKeywordController::class, 'searchKeywords'])->name('searchKeywords');
});
//自定义模板
Route::prefix('custom_module')->group(function () {
Route::any('/', [\App\Http\Controllers\Bside\CustomModule\CustomModuleController::class, 'lists'])->name('custom_lists');
... ...