作者 zhl

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

... ... @@ -55,7 +55,7 @@ class RemainDay extends Command
{
$list = Project::whereIn('type', [2,3,4])->get();
foreach ($list as $item){
if($item['type'] == 3){
if($item['type'] == Project::TYPE_TWO){
//排名达标天数
$compliance_day = GoogleRankModel::where(['project_id' => $item['id'], 'lang' => ''])->value('compliance_day') ?: 0;
$remain_day = $item['deploy_build']['service_duration'] - $compliance_day;
... ...
... ... @@ -619,6 +619,7 @@ class ProjectController extends BaseController
$domain_array = parse_url($domain_pro ? $domain_pro->domain : '');
$domain = $domain_array['host'] ?? $domain_array['path'];
}
$manage = new Manage();
$param = [
"id" => $item['id'],
"title" => $item['title'],
... ... @@ -639,8 +640,11 @@ class ProjectController extends BaseController
"test_domain" => $item['deploy_build']['test_domain'] ?? '',
"online_time" => $item['online_check']['qa_check_time'] ?? '',
"cooperate_date" => $item['cooperate_date'],
"project_manager_name" => $manage->getName($item['deploy_build']['manager_mid']), //项目经理
"after_sales_manager_name" => $manage->getName($item['deploy_optimize']['manager_mid']), //售后服务经理
"leader_name" => $manage->getName($item['deploy_build']['leader_mid']), //组长
];
if ($item['type'] == 3) {
if ($item['type'] == Project::TYPE_TWO) {
$param['is_compliance'] = RankData::where('project_id', $item['id'])->where('lang', '')->value('is_compliance') ?: 0;
} else {
$param['is_compliance'] = 1;
... ...
... ... @@ -29,7 +29,7 @@ class NavController extends BaseController
*/
public function index(BNav $nav){
$this->map['project_id'] = $this->user['project_id'];
$lists = $nav->list($this->map,$this->order = 'sort');
$lists = $nav->list($this->map,$this->order = ['sort','id']);
$data = array();
foreach ($lists as $v){
$v = (array)$v;
... ...
... ... @@ -120,7 +120,7 @@ class ProjectLogic extends BaseLogic
DB::rollBack();
$this->fail('请填写完整后再提交');
}
app(SyncService::class)->projectAcceptAddress($this->param['id']);
(new SyncService())->projectAcceptAddress($this->param['id']);
return $this->success();
}
... ...
... ... @@ -68,7 +68,6 @@ class BTemplateLogic extends BaseLogic
if($this->param['source'] == $this->model::SOURCE_PRODUCT){//产品页
$TemplateInfo = $this->productHtml($info,$this->param['source'],$this->param['source_id']);
}
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($TemplateInfo['html'], true) . PHP_EOL, FILE_APPEND);
return $this->success($TemplateInfo);
}
... ...
... ... @@ -89,7 +89,7 @@ class CustomTemplateLogic extends BaseLogic
public function saveHtml(){
$html = $this->param['html'];
$this->saveCommonTemplate($html);
$this->param['html'] = characterTruncation($html,'/<main>(.*?)<\/main>/s');
$this->param['html'] = characterTruncation($html,'/<main\b[^>]*>(.*?)<\/main>/s');
$this->param['html_style'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s');
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
if($rs === false){
... ...
... ... @@ -69,15 +69,6 @@ class BaseLogic extends Logic
*/
public function getParam(){
$requestAll = $this->request->all();
foreach ($requestAll as $k => $v){
if(is_array($v)){
continue;
}else{
if(empty($v) && ($v == null)){
unset($requestAll[$k]);
}
}
}
return $this->success($requestAll);
}
... ...
... ... @@ -26,6 +26,7 @@ class NavLogic extends BaseLogic
$this->model = new BNav();
}
/**
* @remark :保存数据
* @name :navSave
... ... @@ -35,8 +36,6 @@ class NavLogic extends BaseLogic
*/
public function navSave()
{
DB::beginTransaction();
try {
if(!empty($this->param['location'])){
if($this->param['location'] == 'header'){
$this->param['group_id'] = BNavGroup::DEFAULT_HEADER_ID;
... ... @@ -54,11 +53,6 @@ class NavLogic extends BaseLogic
$this->param['project_id'] = $this->user['project_id'];
$this->model->add($this->param);
}
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('error');
}
//编辑菜单后,通知更新
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NAV, 'route'=>'all']);
return $this->success();
... ...
... ... @@ -110,8 +110,8 @@ class CategoryLogic extends BaseLogic
* @time :2023/8/21 17:14
*/
public function categorySave(){
DB::beginTransaction();
try {
// DB::beginTransaction();
// try {
if(isset($this->param['id']) && !empty($this->param['id'])){
//是否编辑路由
$id = $this->editCategoryRoute($this->param['id'],$this->param['route']);
... ... @@ -128,11 +128,11 @@ class CategoryLogic extends BaseLogic
$this->edit(['route'=>$route],['id'=>$id]);
//清除缓存
Common::del_user_cache('product_category',$this->user['project_id']);
DB::commit();
} catch (\Exception $e){
DB::rollBack();
$this->fail('系统错误,请联系管理员');
}
// DB::commit();
// } catch (\Exception $e){
// DB::rollBack();
// $this->fail('系统错误,请联系管理员');
// }
//通知更新
$notifyData = ['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT_CATE, 'route'=>$route];
$this->updateNotify($notifyData);
... ...
... ... @@ -461,7 +461,7 @@ class RankDataLogic extends BaseLogic
//保证关键词数
$keyword_num = DeployBuild::where('project_id', $project_id)->value('keyword_num');
$type = Project::where('id', $project_id)->value('type');
if($keyword_num && $type == 2 && $first_page_num >= $keyword_num){
if($keyword_num && $type == Project::TYPE_TWO && $first_page_num >= $keyword_num){
$model->compliance_day = $model->compliance_day + 1;
$model->is_compliance = 1;
... ...
... ... @@ -14,7 +14,6 @@ class WebSettingLogic extends BaseLogic
public function __construct()
{
parent::__construct();
$this->model = new WebSetting();
$this->param = $this->requestAll;
}
... ... @@ -26,14 +25,10 @@ class WebSettingLogic extends BaseLogic
* @time :2023/4/28 15:14
*/
public function setting_read(){
$info = CommonHelper::get_user_cache($this->model->getTable(),$this->user['project_id']);
if(empty($info)){
$info = $this->model->read(['project_id'=>$this->user['project_id']]);
if($info === false){
$info = [];
}
CommonHelper::set_user_cache($info,$this->model->getTable(),$this->user['project_id']);
}
return $this->success($info);
}
... ...
... ... @@ -35,6 +35,7 @@ class NavRequest extends FormRequest
// 'group_id' => ['required','integer'],
'pid' => ['required','integer'],
'name' => ['required','max:100'],
'url' => ['required'],
];
return $rule;
}
... ... @@ -49,6 +50,7 @@ class NavRequest extends FormRequest
'pid.integer' => '上级选择错误',
'name.required' => '名称必须',
'name.max' => '名称不能超过100个字符',
'url.required' => '链接不能为空',
];
}
}
... ...