作者 张关杰

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate

... ... @@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command
protected $description = '升级项目统计';
public function handle(){
$project_id = 769;
$project_id = 528;
ProjectServer::useProject($project_id);
$this->count($project_id);
DB::disconnect('custom_mysql');
... ...
... ... @@ -36,7 +36,7 @@ class UpgradeProjectCount extends Command
protected $description = '升级项目统计';
public function handle(){
$project_id = 769;
$project_id = 528;
$oldModel = new UpdateOldInfo();
$info = $oldModel->read(['project_id'=>$project_id]);
$url = $info['old_domain_online'];
... ...
... ... @@ -50,7 +50,7 @@ class UpdateProductCategory extends Command
public function handle(){
//获取所有项目
$projectModel = new Project();
$list = $projectModel->list(['id'=>['in',[475]]],'id',['id']);
$list = $projectModel->list(['id'=>['in',[302]]],'id',['id']);
echo date('Y-m-d H:i:s') . ' start: ' . json_encode($list) . PHP_EOL;
try {
foreach ($list as $v) {
... ...
... ... @@ -27,8 +27,6 @@ class ATemplateModuleController extends BaseController
public function lists(ATemplateModuleLogic $ATemplateModuleLogic){
if(isset($this->map['type']) && ($this->map['type'] == 99)){
$this->map['type'] = 99;
}else{
$this->map['project_id'] = 0;
}
$lists = $ATemplateModuleLogic->aTemplateModuleLists($this->map,$this->page,$this->row,$this->order);
$this->response('success',Code::SUCCESS,$lists);
... ...
... ... @@ -135,7 +135,10 @@ class KeywordController extends BaseController
'title.array' => 'title为数组',
'title.max' => '批量操作不能超过1000条数据'
]);
$logic->batchAdd();
$rs = $logic->batchAdd();
if($rs === false){
$this->response('创建任务添加关键词任务失败,请稍后重试!',Code::SYSTEM_ERROR);
}
$this->response('关键词后台异步添加中,请稍后刷新查看!');
}
... ...
... ... @@ -20,6 +20,7 @@ use App\Models\Product\Product;
use App\Models\Template\Setting;
use App\Models\Template\BTemplate;
use App\Models\User\User;
use App\Models\WebSetting\SettingNum;
use App\Rules\Ids;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
... ... @@ -468,4 +469,51 @@ class ProductController extends BaseController
$logic->setAllSort();
$this->response('success');
}
/**
* @remark :设置产品排序
* @name :setProductSort
* @author :lyh
* @method :post
* @time :2024/1/31 10:14
*/
public function setProductSort(){
$setNumModel = new SettingNum();
try {
if(isset($this->param['id']) && !empty($this->param['id'])){
//执行编辑
$param = [
'data'=>json_encode($this->param['data']),
];
$setNumModel->edit($param,['id'=>$this->param['id']]);
}else{
//执行新增
$param = [
'type'=>$setNumModel::TYPE_PRODUCT_SORT,
'project_id'=>$this->user['project_id'],
'data'=>json_encode($this->param['data']),
];
$setNumModel->add($param);
}
}catch (\Exception $e){
$this->fail('系统错误,请联系管理员');
}
$this->response('success');
}
/**
* @remark :获取产品排序
* @name :getProductSort
* @author :lyh
* @method :post
* @time :2024/1/31 10:24
*/
public function getProductSort(){
$setNumModel = new SettingNum();
$info = $setNumModel->read(['type'=>$setNumModel::TYPE_PRODUCT_SORT]);
if($info === false){
$info = [];
}
$this->response('success',Code::SUCCESS,$info);
}
}
... ...
... ... @@ -46,9 +46,16 @@ class OnlineCheckLogic extends BaseLogic
if(($info['qa_mid'] != 0) && ($info['qa_mid'] != $this->manager['id'])){
$this->fail('你无权限提交审核');
}
$projectModel = new Project();
$projectInfo = $projectModel->read(['id'=>$this->param['id']]);
if(!empty($projectInfo['uptime'])){
$param['uptime'] = date('Y-m-d H:i:s');
}
if(isset($this->param['project_type']) && !empty($this->param['project_type'])){
$projectModel = new Project();
$projectModel->edit(['type'=>$this->param['project_type']],['id'=>$this->param['id']]);
$param['type'] = $this->param['project_type'];
}
if(isset($param)){
$projectModel->edit($param,['id'=>$this->param['id']]);
}
}
$data = [
... ...
... ... @@ -65,7 +65,11 @@ class CustomTemplateLogic extends BaseLogic
public function customTemplateSave(){
$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']);
$is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
$six_read = $this->param['six_read'] ?? 0;//5.0数据时,是否按6.0显示
if($is_upgrade == 0 || $six_read == 1) {
$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{
... ...
... ... @@ -34,7 +34,7 @@ class BlogLogic extends BaseLogic
try {
$this->param = $this->paramProcessing($this->param);
if(isset($this->param['id']) && !empty($this->param['id'])){
$is_upgrade = $this->param['is_upgrade'] ?? 0;//5.0数据 1:6.0
$is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
$six_read = $this->param['six_read'] ?? 0;//是否按6.0显示
if($is_upgrade == 0 || $six_read == 1){
$this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $this->param['id'], $this->user['project_id']);
... ... @@ -199,7 +199,7 @@ class BlogLogic extends BaseLogic
foreach ($category as $v){
$str .= $v.',';
}
return !empty($str) ? ','.$str : '';
return !empty(trim($str,',')) ? ','.$str.',' : '';
}
/**
... ...
... ... @@ -64,7 +64,7 @@ class NewsLogic extends BaseLogic
try {
$this->param = $this->paramProcessing($this->param);
if (isset($this->param['id']) && !empty($this->param['id'])) {
$is_upgrade = $this->param['is_upgrade'] ?? 0;//5.0数据 1:6.0
$is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
$six_read = $this->param['six_read'] ?? 0;//是否按6.0显示
if($is_upgrade == 0 || $six_read == 1) {
$this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $this->param['id'], $this->user['project_id']);
... ... @@ -217,7 +217,7 @@ class NewsLogic extends BaseLogic
foreach ($category as $v){
$str .= $v.',';
}
return !empty($str) ? ','.$str : '';
return !empty(trim($str,',')) ? ','.$str.',' : '';
}
/**
... ...
... ... @@ -248,7 +248,7 @@ class CategoryLogic extends BaseLogic
$str .= $v.',';
}
}
return !empty($str) ? ','.$str : '';
return !empty(trim($str,',')) ? ','.$str.',' : '';
}
/**
... ...
... ... @@ -145,10 +145,10 @@ class KeywordLogic extends BaseLogic
$this->model->insertGetId($param);
}
}
NoticeLog::createLog(NoticeLog::TYPE_INIT_KEYWORD, ['project_id' => $this->user['project_id']]);
}catch (\Exception $e){
$this->fail('创建任务添加关键词任务失败,请稍后重试!');
return false;
}
NoticeLog::createLog(NoticeLog::TYPE_INIT_KEYWORD, ['project_id' => $this->user['project_id']]);
return $this->success();
}
... ...
... ... @@ -46,7 +46,7 @@ class ProductLogic extends BaseLogic
$this->param = $this->handleSaveParam($this->param);
try {
if(isset($this->param['id']) && !empty($this->param['id'])){
$is_upgrade = $this->param['is_upgrade'] ?? 0;//5.0数据 1:6.0数据
$is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
$six_read = $this->param['six_read'] ?? 0;//是否按6.0显示
if($is_upgrade == 0 || $six_read == 1){
$this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $this->param['id'], $this->user['project_id']);
... ... @@ -197,6 +197,7 @@ class ProductLogic extends BaseLogic
* @time :2023/10/26 9:49
*/
public function editList(){
$category_ids = $this->param['category_id'];
$this->param['category_id'] = $this->handleListCategory($this->param['category_id']);
$this->param['keyword_id'] = $this->saveKeyword($this->param['keyword_id']);
if(isset($this->param['gallery']) && !empty($this->param['gallery'])){
... ... @@ -215,6 +216,8 @@ class ProductLogic extends BaseLogic
$this->editProductRoute($this->param['id'],$this->param['route']);
}
$this->model->edit($this->param,['id'=>$this->param['id']]);
//产品分类关联
CategoryRelated::saveRelated($this->param['id'], $category_ids);
}catch (\Exception $e){
$this->fail('系统错误,请连续管理员');
}
... ... @@ -317,7 +320,7 @@ class ProductLogic extends BaseLogic
$str .= $v.',';
}
}
return !empty($str) ? ','.$str : '';
return !empty(trim($str,',')) ? ','.$str.',' : '';
}
/**
... ...
... ... @@ -5,6 +5,7 @@ namespace App\Models\Inquiry;
use App\Models\Base;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Str;
/**
* Class InquiryForm
... ... @@ -36,10 +37,11 @@ class InquiryForm extends Base
'phone' => '电话',
'mobile' => '电话',
'message' => '询盘内容',
'company' => '公司名称'
'company' => '公司名称',
'file' => '文件'
];
if($field){
return $map[$field] ?? $field;
return $map[Str::lower($field)] ?? Str::studly($field);
}
return $map;
}
... ... @@ -70,6 +72,7 @@ class InquiryForm extends Base
unset($data['globalso-domain']);
unset($data['globalso-edition']);
unset($data['globalso-date']);
ksort($data);
$field = array_keys($data);
$sign = md5(json_encode($field));
... ...
... ... @@ -20,6 +20,8 @@ use App\Models\Base;
*/
class SettingNum extends Base
{
const TYPE_PRODUCT_SORT = 10;//c端显示排序
protected $table = 'gl_setting_num';
//连接数据库
protected $connection = 'custom_mysql';
... ...
... ... @@ -70,6 +70,9 @@ class SyncSubmitTaskService
$this->inquiryFilter($data['project_id'], $data);
//数组key转为小写
$data['data'] = array_change_key_case($data['data'], CASE_LOWER);
$form_id = InquiryForm::getFromId($data['data']);
InquiryFormData::saveData($form_id, $data['domain'], $data['ip'], $data['country'], $data['referer'], $data['user_agent'], $data['submit_at'], $data['data']);
... ...
... ... @@ -223,6 +223,8 @@ Route::middleware(['bloginauth'])->group(function () {
Route::post('/editList', [\App\Http\Controllers\Bside\Product\ProductController::class, 'editList'])->name('product_editList');
Route::post('/sort', [\App\Http\Controllers\Bside\Product\ProductController::class, 'sort'])->name('product_sort');
Route::post('/allSort', [\App\Http\Controllers\Bside\Product\ProductController::class, 'allSort'])->name('product_allSort');
Route::post('/setProductSort', [\App\Http\Controllers\Bside\Product\ProductController::class, 'setProductSort'])->name('product_setProductSort');
Route::post('/getProductSort', [\App\Http\Controllers\Bside\Product\ProductController::class, 'getProductSort'])->name('product_getProductSort');
Route::any('/delete', [\App\Http\Controllers\Bside\Product\ProductController::class, 'delete'])->name('product_delete');
Route::any('/statusNum', [\App\Http\Controllers\Bside\Product\ProductController::class, 'getStatusNumber'])->name('product_statusNum');
Route::any('/copyProduct', [\App\Http\Controllers\Bside\Product\ProductController::class, 'copyProduct'])->name('product_copyProduct');
... ...