Merge remote-tracking branch 'origin/master' into zhl
正在显示
13 个修改的文件
包含
165 行增加
和
24 行删除
| @@ -10,9 +10,11 @@ use App\Models\Mail\Mail; | @@ -10,9 +10,11 @@ use App\Models\Mail\Mail; | ||
| 10 | use App\Services\ProjectServer; | 10 | use App\Services\ProjectServer; |
| 11 | use Illuminate\Console\Command; | 11 | use Illuminate\Console\Command; |
| 12 | use Illuminate\Support\Facades\DB; | 12 | use Illuminate\Support\Facades\DB; |
| 13 | +use Illuminate\Support\Facades\Redis; | ||
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| 15 | - * Class GoogleRank | 16 | + * 导入任务异步执行 |
| 17 | + * Class ProjectImport | ||
| 16 | * @package App\Console\Commands | 18 | * @package App\Console\Commands |
| 17 | * @author Akun | 19 | * @author Akun |
| 18 | * @date 2023/9/20 15:18 | 20 | * @date 2023/9/20 15:18 |
| @@ -43,7 +45,13 @@ class ProjectImport extends Command | @@ -43,7 +45,13 @@ class ProjectImport extends Command | ||
| 43 | 45 | ||
| 44 | protected function start_import() | 46 | protected function start_import() |
| 45 | { | 47 | { |
| 46 | - $task = ImportTask::where('status', ImportTask::STATUS_UN)->first(); | 48 | + $task_id = $this->get_task(); |
| 49 | + if (!$task_id) { | ||
| 50 | + sleep(2); | ||
| 51 | + return true; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + $task = ImportTask::where('id', $task_id)->where('status', ImportTask::STATUS_UN)->first(); | ||
| 47 | if (!$task) { | 55 | if (!$task) { |
| 48 | sleep(2); | 56 | sleep(2); |
| 49 | return true; | 57 | return true; |
| @@ -51,6 +59,9 @@ class ProjectImport extends Command | @@ -51,6 +59,9 @@ class ProjectImport extends Command | ||
| 51 | 59 | ||
| 52 | echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', import start' . PHP_EOL; | 60 | echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', import start' . PHP_EOL; |
| 53 | 61 | ||
| 62 | + $task->status = ImportTask::STATUS_ING;//导入中 | ||
| 63 | + $task->save(); | ||
| 64 | + | ||
| 54 | $is_gbk = 0; | 65 | $is_gbk = 0; |
| 55 | $file_code_type = $this->get_code_type($task->file_url); | 66 | $file_code_type = $this->get_code_type($task->file_url); |
| 56 | if ($file_code_type === false) { | 67 | if ($file_code_type === false) { |
| @@ -86,8 +97,6 @@ class ProjectImport extends Command | @@ -86,8 +97,6 @@ class ProjectImport extends Command | ||
| 86 | $success_count = 0; //成功导入条数 | 97 | $success_count = 0; //成功导入条数 |
| 87 | $repeat_count = 0; //过滤已存在条数 | 98 | $repeat_count = 0; //过滤已存在条数 |
| 88 | if (count($line_of_text) > 1) { | 99 | if (count($line_of_text) > 1) { |
| 89 | - $task->status = ImportTask::STATUS_ING;//导入中 | ||
| 90 | - $task->save(); | ||
| 91 | 100 | ||
| 92 | //设置数据库 | 101 | //设置数据库 |
| 93 | $project = ProjectServer::useProject($task->project_id); | 102 | $project = ProjectServer::useProject($task->project_id); |
| @@ -144,6 +153,28 @@ class ProjectImport extends Command | @@ -144,6 +153,28 @@ class ProjectImport extends Command | ||
| 144 | sleep(2); | 153 | sleep(2); |
| 145 | } | 154 | } |
| 146 | 155 | ||
| 156 | + //获取任务 | ||
| 157 | + protected function get_task() | ||
| 158 | + { | ||
| 159 | + $key = 'console_import_task'; | ||
| 160 | + $task_id = Redis::rpop($key); | ||
| 161 | + if ($task_id) { | ||
| 162 | + return $task_id; | ||
| 163 | + } | ||
| 164 | + | ||
| 165 | + $task_list = ImportTask::where('status', ImportTask::STATUS_UN)->limit(20)->get(); | ||
| 166 | + if ($task_list->count() == 0) { | ||
| 167 | + return false; | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + foreach ($task_list as $value) { | ||
| 171 | + Redis::lpush($key, $value->id); | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + $task_id = Redis::rpop($key); | ||
| 175 | + return $task_id; | ||
| 176 | + } | ||
| 177 | + | ||
| 147 | //判断编码格式 | 178 | //判断编码格式 |
| 148 | protected function get_code_type($file) | 179 | protected function get_code_type($file) |
| 149 | { | 180 | { |
| @@ -158,7 +189,7 @@ class ProjectImport extends Command | @@ -158,7 +189,7 @@ class ProjectImport extends Command | ||
| 158 | return false; | 189 | return false; |
| 159 | } | 190 | } |
| 160 | 191 | ||
| 161 | - //发生站内通知 | 192 | + //发送站内通知 |
| 162 | protected function send_mail($user_list, $time, $type, $success_count, $repeat_count, $reason) | 193 | protected function send_mail($user_list, $time, $type, $success_count, $repeat_count, $reason) |
| 163 | { | 194 | { |
| 164 | if ($type == ImportTask::TYPE_NEWS) { | 195 | if ($type == ImportTask::TYPE_NEWS) { |
| @@ -117,7 +117,7 @@ if (!function_exists('_get_child')) { | @@ -117,7 +117,7 @@ if (!function_exists('_get_child')) { | ||
| 117 | function _get_child($my_id, $arr) | 117 | function _get_child($my_id, $arr) |
| 118 | { | 118 | { |
| 119 | $new_arr = array(); | 119 | $new_arr = array(); |
| 120 | - foreach ($arr as $k => $v) { | 120 | + foreach ($arr as $v) { |
| 121 | $v = (array)$v; | 121 | $v = (array)$v; |
| 122 | if ($v['pid'] == $my_id) { | 122 | if ($v['pid'] == $my_id) { |
| 123 | $v['sub'] = _get_child($v['id'], $arr); | 123 | $v['sub'] = _get_child($v['id'], $arr); |
| @@ -11,6 +11,7 @@ use App\Models\Domain\DomainInfo; | @@ -11,6 +11,7 @@ use App\Models\Domain\DomainInfo; | ||
| 11 | use App\Models\Manage\Manage; | 11 | use App\Models\Manage\Manage; |
| 12 | use App\Models\Project\OnlineCheck; | 12 | use App\Models\Project\OnlineCheck; |
| 13 | use App\Models\Project\Project; | 13 | use App\Models\Project\Project; |
| 14 | +use App\Models\RankData\RankData; | ||
| 14 | use App\Models\Task\Task; | 15 | use App\Models\Task\Task; |
| 15 | use Illuminate\Support\Facades\DB; | 16 | use Illuminate\Support\Facades\DB; |
| 16 | 17 | ||
| @@ -36,8 +37,12 @@ class OptimizeController extends BaseController | @@ -36,8 +37,12 @@ class OptimizeController extends BaseController | ||
| 36 | ->leftJoin('gl_project_online_check', 'gl_project.id', '=', 'gl_project_online_check.project_id'); | 37 | ->leftJoin('gl_project_online_check', 'gl_project.id', '=', 'gl_project_online_check.project_id'); |
| 37 | $query = $this->searchParam($query); | 38 | $query = $this->searchParam($query); |
| 38 | $lists = $query->paginate($this->row, $this->selectParam(), 'page', $this->page)->toArray(); | 39 | $lists = $query->paginate($this->row, $this->selectParam(), 'page', $this->page)->toArray(); |
| 39 | - if(!empty($lists['list'])){ | 40 | + if(!empty($lists) && !empty($lists['list'])){ |
| 41 | + $rankDataModel = new RankData(); | ||
| 40 | foreach ($lists['list'] as $k => $v){ | 42 | foreach ($lists['list'] as $k => $v){ |
| 43 | + $data = $rankDataModel->read(['project_id'=>$v['id'],'lang'=>''],['first_page_num','indexed_pages_num']); | ||
| 44 | + $v['first_page_num'] = $data['first_page_num'] ?? 0; | ||
| 45 | + $v['indexed_pages_num'] = $data['indexed_pages_num'] ?? 0; | ||
| 41 | $v = $this->handleParam($v); | 46 | $v = $this->handleParam($v); |
| 42 | $lists['list'][$k] = $v; | 47 | $lists['list'][$k] = $v; |
| 43 | } | 48 | } |
| @@ -74,7 +79,6 @@ class OptimizeController extends BaseController | @@ -74,7 +79,6 @@ class OptimizeController extends BaseController | ||
| 74 | $item['product_num'] = $data['product'] ?? 0; | 79 | $item['product_num'] = $data['product'] ?? 0; |
| 75 | $item['keyword_num'] = $item['key'] ?? 0; | 80 | $item['keyword_num'] = $item['key'] ?? 0; |
| 76 | $item['autologin_code'] = getAutoLoginCode($item['id']); | 81 | $item['autologin_code'] = getAutoLoginCode($item['id']); |
| 77 | -// $item['article_num'] = ($data['blog'] ?? 0) + ($data['news'] ?? 0); | ||
| 78 | return $item; | 82 | return $item; |
| 79 | } | 83 | } |
| 80 | /** | 84 | /** |
| @@ -92,8 +96,10 @@ class OptimizeController extends BaseController | @@ -92,8 +96,10 @@ class OptimizeController extends BaseController | ||
| 92 | 'gl_project.company AS company', | 96 | 'gl_project.company AS company', |
| 93 | 'gl_project.type AS type', | 97 | 'gl_project.type AS type', |
| 94 | 'gl_project.created_at AS created_at', | 98 | 'gl_project.created_at AS created_at', |
| 99 | + 'gl_project.is_language AS is_language', | ||
| 95 | 'gl_project.cooperate_date AS cooperate_date', | 100 | 'gl_project.cooperate_date AS cooperate_date', |
| 96 | 'gl_project.finish_remain_day AS finish_remain_day', | 101 | 'gl_project.finish_remain_day AS finish_remain_day', |
| 102 | + 'gl_project.is_remain_today AS is_remain_today', | ||
| 97 | 'gl_project.remain_day AS remain_day', | 103 | 'gl_project.remain_day AS remain_day', |
| 98 | 'gl_project_online_check.id AS online_check_id', | 104 | 'gl_project_online_check.id AS online_check_id', |
| 99 | 'gl_project_online_check.question AS question', | 105 | 'gl_project_online_check.question AS question', |
| @@ -120,7 +126,6 @@ class OptimizeController extends BaseController | @@ -120,7 +126,6 @@ class OptimizeController extends BaseController | ||
| 120 | 'gl_project_deploy_optimize.domain AS domain', | 126 | 'gl_project_deploy_optimize.domain AS domain', |
| 121 | 'gl_project_deploy_optimize.quality_mid AS quality_mid', | 127 | 'gl_project_deploy_optimize.quality_mid AS quality_mid', |
| 122 | 'gl_project_deploy_optimize.design_mid AS design_mid', | 128 | 'gl_project_deploy_optimize.design_mid AS design_mid', |
| 123 | - 'gl_project_deploy_optimize.special AS special', | ||
| 124 | ]; | 129 | ]; |
| 125 | return $select; | 130 | return $select; |
| 126 | } | 131 | } |
| @@ -196,7 +196,7 @@ class ProjectController extends BaseController | @@ -196,7 +196,7 @@ class ProjectController extends BaseController | ||
| 196 | * @time :2023/9/7 17:28 | 196 | * @time :2023/9/7 17:28 |
| 197 | */ | 197 | */ |
| 198 | public function getManagerRole(&$query){ | 198 | public function getManagerRole(&$query){ |
| 199 | - if($this->manage['role'] != 1 || $this->manage['gid'] == 0){//1代表查看所有 | 199 | + if(($this->manage['role'] != 1)){//1代表查看所有 |
| 200 | //获取用户所在组 | 200 | //获取用户所在组 |
| 201 | $managerHr = new ManageHr(); | 201 | $managerHr = new ManageHr(); |
| 202 | $info = $managerHr->read(['manage_id'=>$this->manage['id']]); | 202 | $info = $managerHr->read(['manage_id'=>$this->manage['id']]); |
| @@ -15,6 +15,7 @@ use App\Http\Logic\Bside\Setting\WebSettingLogic; | @@ -15,6 +15,7 @@ use App\Http\Logic\Bside\Setting\WebSettingLogic; | ||
| 15 | use App\Models\Com\UpdateNotify; | 15 | use App\Models\Com\UpdateNotify; |
| 16 | use App\Models\Com\UpdateProgress; | 16 | use App\Models\Com\UpdateProgress; |
| 17 | use App\Models\Project\Country as CountryModel; | 17 | use App\Models\Project\Country as CountryModel; |
| 18 | +use App\Models\Project\Project; | ||
| 18 | use App\Models\RouteMap\RouteMap; | 19 | use App\Models\RouteMap\RouteMap; |
| 19 | use App\Models\WebSetting\WebSettingCountry; | 20 | use App\Models\WebSetting\WebSettingCountry; |
| 20 | use Illuminate\Http\Request; | 21 | use Illuminate\Http\Request; |
| @@ -49,7 +50,6 @@ class CNoticeController extends BaseController | @@ -49,7 +50,6 @@ class CNoticeController extends BaseController | ||
| 49 | $this->updateMinorLanguages(); | 50 | $this->updateMinorLanguages(); |
| 50 | } | 51 | } |
| 51 | $urlStr = $this->getString($this->param['type'],$this->param['page']); | 52 | $urlStr = $this->getString($this->param['type'],$this->param['page']); |
| 52 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($urlStr, true) . PHP_EOL, FILE_APPEND); | ||
| 53 | curlGet($urlStr); | 53 | curlGet($urlStr); |
| 54 | $this->response('更新成功'); | 54 | $this->response('更新成功'); |
| 55 | } | 55 | } |
| @@ -110,6 +110,11 @@ class CNoticeController extends BaseController | @@ -110,6 +110,11 @@ class CNoticeController extends BaseController | ||
| 110 | $extent = json_encode(['url'=>$this->param['url'],'language'=>$this->param['language']]); | 110 | $extent = json_encode(['url'=>$this->param['url'],'language'=>$this->param['language']]); |
| 111 | $this->addProgress($count,$this->param['type'],$this->param['page'],$extent); | 111 | $this->addProgress($count,$this->param['type'],$this->param['page'],$extent); |
| 112 | } | 112 | } |
| 113 | + //更新小语种,同步更新项目表已翻译小语种 | ||
| 114 | + if(isset($this->user['is_domain']) && ($this->user['is_domain'] != 0)){ | ||
| 115 | + $projectModel = new Project(); | ||
| 116 | + $projectModel->edit(['is_language'=>$this->user['is_domain']],['id'=>$this->user['project_id']]); | ||
| 117 | + } | ||
| 113 | }catch (\Exception $e){ | 118 | }catch (\Exception $e){ |
| 114 | $this->response('error',Code::USER_ERROR); | 119 | $this->response('error',Code::USER_ERROR); |
| 115 | } | 120 | } |
| @@ -92,6 +92,25 @@ class BlogCategoryController extends BaseController | @@ -92,6 +92,25 @@ class BlogCategoryController extends BaseController | ||
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | /** | 94 | /** |
| 95 | + * @remark :排序 | ||
| 96 | + * @name :sort | ||
| 97 | + * @author :lyh | ||
| 98 | + * @method :post | ||
| 99 | + * @time :2023/9/26 17:40 | ||
| 100 | + */ | ||
| 101 | + public function sort(BlogCategoryLogic $blogCategoryLogic){ | ||
| 102 | + $this->request->validate([ | ||
| 103 | + 'id'=>'required', | ||
| 104 | + 'sort'=>'required' | ||
| 105 | + ],[ | ||
| 106 | + 'id.required' => '产品ID不能为空', | ||
| 107 | + 'sort.required'=>'排序字段不能为空' | ||
| 108 | + ]); | ||
| 109 | + $blogCategoryLogic->setSort(); | ||
| 110 | + $this->response('success'); | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + /** | ||
| 95 | * @name :删除分类 | 114 | * @name :删除分类 |
| 96 | * @author :liyuhang | 115 | * @author :liyuhang |
| 97 | * @method | 116 | * @method |
| @@ -20,7 +20,7 @@ class NewsCategoryController extends BaseController | @@ -20,7 +20,7 @@ class NewsCategoryController extends BaseController | ||
| 20 | public function lists(NewsCategoryModel $newsCategory){ | 20 | public function lists(NewsCategoryModel $newsCategory){ |
| 21 | //搜索条件 | 21 | //搜索条件 |
| 22 | $this->map['project_id'] = $this->user['project_id']; | 22 | $this->map['project_id'] = $this->user['project_id']; |
| 23 | - $lists = $newsCategory->lists($this->map,$this->page,$this->row,$this->order, | 23 | + $lists = $newsCategory->lists($this->map,$this->page,$this->row,$this->order = 'sort', |
| 24 | ['id','pid','name','num','alias','status','sort','remark','created_at','updated_at']); | 24 | ['id','pid','name','num','alias','status','sort','remark','created_at','updated_at']); |
| 25 | if(!empty($lists['list'])){ | 25 | if(!empty($lists['list'])){ |
| 26 | $newsModel = new NewsModel(); | 26 | $newsModel = new NewsModel(); |
| @@ -91,6 +91,23 @@ class NewsCategoryController extends BaseController | @@ -91,6 +91,23 @@ class NewsCategoryController extends BaseController | ||
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | /** | 93 | /** |
| 94 | + * @remark :排序 | ||
| 95 | + * @name :sort | ||
| 96 | + * @author :lyh | ||
| 97 | + * @method :post | ||
| 98 | + * @time :2023/9/26 17:35 | ||
| 99 | + */ | ||
| 100 | + public function sort(NewsCategoryLogic $newsCategoryLogic){ | ||
| 101 | + $this->request->validate([ | ||
| 102 | + 'id'=>['required'], | ||
| 103 | + ],[ | ||
| 104 | + 'id.required' => 'ID不能为空', | ||
| 105 | + ]); | ||
| 106 | + $newsCategoryLogic->categorySort(); | ||
| 107 | + $this->response('success'); | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + /** | ||
| 94 | * @name :删除分类 | 111 | * @name :删除分类 |
| 95 | * @author :liyuhang | 112 | * @author :liyuhang |
| 96 | * @method | 113 | * @method |
| @@ -113,6 +113,23 @@ class CategoryController extends BaseController | @@ -113,6 +113,23 @@ class CategoryController extends BaseController | ||
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | /** | 115 | /** |
| 116 | + * @remark :排序 | ||
| 117 | + * @name :sort | ||
| 118 | + * @author :lyh | ||
| 119 | + * @method :post | ||
| 120 | + * @time :2023/9/26 17:35 | ||
| 121 | + */ | ||
| 122 | + public function sort(CategoryLogic $logic){ | ||
| 123 | + $this->request->validate([ | ||
| 124 | + 'id'=>['required'], | ||
| 125 | + ],[ | ||
| 126 | + 'id.required' => 'ID不能为空', | ||
| 127 | + ]); | ||
| 128 | + $logic->categorySort(); | ||
| 129 | + $this->response('success'); | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + /** | ||
| 116 | * @remark :删除数据 | 133 | * @remark :删除数据 |
| 117 | * @name :delete | 134 | * @name :delete |
| 118 | * @author :lyh | 135 | * @author :lyh |
| @@ -330,7 +330,21 @@ class BlogCategoryLogic extends BaseLogic | @@ -330,7 +330,21 @@ class BlogCategoryLogic extends BaseLogic | ||
| 330 | } | 330 | } |
| 331 | $return[] = $c_id; | 331 | $return[] = $c_id; |
| 332 | } | 332 | } |
| 333 | - | ||
| 334 | return ','.implode(',',$return).','; | 333 | return ','.implode(',',$return).','; |
| 335 | } | 334 | } |
| 335 | + | ||
| 336 | + /** | ||
| 337 | + * @remark :排序 | ||
| 338 | + * @name :setSort | ||
| 339 | + * @author :lyh | ||
| 340 | + * @method :post | ||
| 341 | + * @time :2023/8/19 11:16 | ||
| 342 | + */ | ||
| 343 | + public function setSort(){ | ||
| 344 | + $rs = $this->model->edit(['sort'=>$this->param['sort']],['id'=>$this->param['id']]); | ||
| 345 | + if($rs === false){ | ||
| 346 | + $this->fail('error'); | ||
| 347 | + } | ||
| 348 | + return $this->success(); | ||
| 349 | + } | ||
| 336 | } | 350 | } |
| @@ -59,9 +59,9 @@ class NewsCategoryLogic extends BaseLogic | @@ -59,9 +59,9 @@ class NewsCategoryLogic extends BaseLogic | ||
| 59 | */ | 59 | */ |
| 60 | public function newsCategorySave(){ | 60 | public function newsCategorySave(){ |
| 61 | //验证名称是否存在 | 61 | //验证名称是否存在 |
| 62 | -// $this->verifyParamName($this->param['name']); | ||
| 63 | -// DB::beginTransaction(); | ||
| 64 | -// try { | 62 | + $this->verifyParamName($this->param['name']); |
| 63 | + DB::beginTransaction(); | ||
| 64 | + try { | ||
| 65 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 65 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 66 | //验证是否可编辑 | 66 | //验证是否可编辑 |
| 67 | $this->verifyEditParam($this->param['id'],$this->param['pid']); | 67 | $this->verifyEditParam($this->param['id'],$this->param['pid']); |
| @@ -78,11 +78,11 @@ class NewsCategoryLogic extends BaseLogic | @@ -78,11 +78,11 @@ class NewsCategoryLogic extends BaseLogic | ||
| 78 | } | 78 | } |
| 79 | $route = RouteMap::setRoute(isset($this->param['alias']) ? $this->param['alias'] : $this->param['name'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']); | 79 | $route = RouteMap::setRoute(isset($this->param['alias']) ? $this->param['alias'] : $this->param['name'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']); |
| 80 | $this->model->edit(['alias'=>$route],['id'=>$id]); | 80 | $this->model->edit(['alias'=>$route],['id'=>$id]); |
| 81 | -// DB::commit(); | ||
| 82 | -// }catch (\Exception $e){ | ||
| 83 | -// DB::rollBack(); | ||
| 84 | -// $this->fail('error'); | ||
| 85 | -// } | 81 | + DB::commit(); |
| 82 | + }catch (\Exception $e){ | ||
| 83 | + DB::rollBack(); | ||
| 84 | + $this->fail('error'); | ||
| 85 | + } | ||
| 86 | //更新通知记录表 | 86 | //更新通知记录表 |
| 87 | $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$route]); | 87 | $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$route]); |
| 88 | return $this->success(); | 88 | return $this->success(); |
| @@ -312,7 +312,21 @@ class NewsCategoryLogic extends BaseLogic | @@ -312,7 +312,21 @@ class NewsCategoryLogic extends BaseLogic | ||
| 312 | } | 312 | } |
| 313 | $return[] = $c_id; | 313 | $return[] = $c_id; |
| 314 | } | 314 | } |
| 315 | - | ||
| 316 | return ','.implode(',',$return).','; | 315 | return ','.implode(',',$return).','; |
| 317 | } | 316 | } |
| 317 | + | ||
| 318 | + /** | ||
| 319 | + * @remark :排序 | ||
| 320 | + * @name :categorySort | ||
| 321 | + * @author :lyh | ||
| 322 | + * @method :post | ||
| 323 | + * @time :2023/9/26 17:38 | ||
| 324 | + */ | ||
| 325 | + public function categorySort(){ | ||
| 326 | + $rs = $this->model->edit(['sort'=>$this->param['sort']],['id'=>$this->param['id']]); | ||
| 327 | + if($rs === false){ | ||
| 328 | + $this->fail('系统错误,请联系管理员'); | ||
| 329 | + } | ||
| 330 | + return $this->success(); | ||
| 331 | + } | ||
| 318 | } | 332 | } |
| @@ -229,7 +229,21 @@ class CategoryLogic extends BaseLogic | @@ -229,7 +229,21 @@ class CategoryLogic extends BaseLogic | ||
| 229 | 229 | ||
| 230 | //清除缓存 | 230 | //清除缓存 |
| 231 | Common::del_user_cache('product_category',$project_id); | 231 | Common::del_user_cache('product_category',$project_id); |
| 232 | - | ||
| 233 | return ','.implode(',',$return).','; | 232 | return ','.implode(',',$return).','; |
| 234 | } | 233 | } |
| 234 | + | ||
| 235 | + /** | ||
| 236 | + * @remark :排序 | ||
| 237 | + * @name :categorySort | ||
| 238 | + * @author :lyh | ||
| 239 | + * @method :post | ||
| 240 | + * @time :2023/9/26 17:38 | ||
| 241 | + */ | ||
| 242 | + public function categorySort(){ | ||
| 243 | + $rs = $this->model->edit(['sort'=>$this->param['sort']],['id'=>$this->param['id']]); | ||
| 244 | + if($rs === false){ | ||
| 245 | + $this->fail('系统错误,请联系管理员'); | ||
| 246 | + } | ||
| 247 | + return $this->success(); | ||
| 248 | + } | ||
| 235 | } | 249 | } |
| @@ -187,7 +187,9 @@ class UserLoginLogic | @@ -187,7 +187,9 @@ class UserLoginLogic | ||
| 187 | $info['aicc'] = $project['aicc'] ?? ''; | 187 | $info['aicc'] = $project['aicc'] ?? ''; |
| 188 | $info['hagro'] = $project['hagro'] ?? ''; | 188 | $info['hagro'] = $project['hagro'] ?? ''; |
| 189 | $info['plan'] = Project::planMap()[$project['deploy_build']['plan']]; | 189 | $info['plan'] = Project::planMap()[$project['deploy_build']['plan']]; |
| 190 | - $info['domain'] = (!empty($project['deploy_optimize']['domain']) ? ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ($project['deploy_build']['test_domain'] ?? '')); | 190 | + $info['is_domain'] = empty($project['deploy_optimize']['domain']) ? 0 : 1; |
| 191 | + $info['domain'] = (!empty($project['deploy_optimize']['domain']) ? | ||
| 192 | + ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ($project['deploy_build']['test_domain'] ?? '')); | ||
| 191 | //保存项目缓存 | 193 | //保存项目缓存 |
| 192 | Cache::put('user-'.$info['project_id'],$project,$minutes = null); | 194 | Cache::put('user-'.$info['project_id'],$project,$minutes = null); |
| 193 | return $this->success($info); | 195 | return $this->success($info); |
| @@ -55,6 +55,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -55,6 +55,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 55 | Route::any('/category/edit', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'save'])->name('news_category_edit'); | 55 | Route::any('/category/edit', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'save'])->name('news_category_edit'); |
| 56 | Route::any('/category/del', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'del'])->name('news_category_del'); | 56 | Route::any('/category/del', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'del'])->name('news_category_del'); |
| 57 | Route::any('/category/status', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'status'])->name('news_category_status'); | 57 | Route::any('/category/status', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'status'])->name('news_category_status'); |
| 58 | + Route::any('/category/sort', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'sort'])->name('news_category_sort'); | ||
| 58 | Route::any('/category/categoryTopList', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'categoryTopList'])->name('news_category_categoryTopList'); | 59 | Route::any('/category/categoryTopList', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'categoryTopList'])->name('news_category_categoryTopList'); |
| 59 | //新闻 | 60 | //新闻 |
| 60 | Route::any('/', [\App\Http\Controllers\Bside\News\NewsController::class, 'lists'])->name('news_category_lists'); | 61 | Route::any('/', [\App\Http\Controllers\Bside\News\NewsController::class, 'lists'])->name('news_category_lists'); |
| @@ -89,6 +90,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -89,6 +90,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 89 | Route::any('/category/edit', [\App\Http\Controllers\Bside\Blog\BlogCategoryController::class, 'save'])->name('blog_category_edit'); | 90 | Route::any('/category/edit', [\App\Http\Controllers\Bside\Blog\BlogCategoryController::class, 'save'])->name('blog_category_edit'); |
| 90 | Route::any('/category/del', [\App\Http\Controllers\Bside\Blog\BlogCategoryController::class, 'del'])->name('blog_category_del'); | 91 | Route::any('/category/del', [\App\Http\Controllers\Bside\Blog\BlogCategoryController::class, 'del'])->name('blog_category_del'); |
| 91 | Route::any('/category/status', [\App\Http\Controllers\Bside\Blog\BlogCategoryController::class, 'status'])->name('blog_category_status'); | 92 | Route::any('/category/status', [\App\Http\Controllers\Bside\Blog\BlogCategoryController::class, 'status'])->name('blog_category_status'); |
| 93 | + Route::any('/category/sort', [\App\Http\Controllers\Bside\Blog\BlogCategoryController::class, 'sort'])->name('blog_category_sort'); | ||
| 92 | Route::any('/category/categoryTopList', [\App\Http\Controllers\Bside\Blog\BlogCategoryController::class, 'categoryTopList'])->name('blog_category_categoryTopList'); | 94 | Route::any('/category/categoryTopList', [\App\Http\Controllers\Bside\Blog\BlogCategoryController::class, 'categoryTopList'])->name('blog_category_categoryTopList'); |
| 93 | //博客标签 | 95 | //博客标签 |
| 94 | Route::any('/label/', [\App\Http\Controllers\Bside\Blog\BlogLabelController::class, 'lists'])->name('blog_lists'); | 96 | Route::any('/label/', [\App\Http\Controllers\Bside\Blog\BlogLabelController::class, 'lists'])->name('blog_lists'); |
| @@ -190,6 +192,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -190,6 +192,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 190 | Route::get('category', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'index'])->name('product_category'); | 192 | Route::get('category', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'index'])->name('product_category'); |
| 191 | Route::get('category/info', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'info'])->name('product_category_info'); | 193 | Route::get('category/info', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'info'])->name('product_category_info'); |
| 192 | Route::post('category/save', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'save'])->name('product_category_save'); | 194 | Route::post('category/save', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'save'])->name('product_category_save'); |
| 195 | + Route::post('category/sort', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'sort'])->name('product_category_sort'); | ||
| 193 | Route::any('category/delete', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'delete'])->name('product_category_delete'); | 196 | Route::any('category/delete', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'delete'])->name('product_category_delete'); |
| 194 | 197 | ||
| 195 | //产品关键词 | 198 | //产品关键词 |
-
请 注册 或 登录 后发表评论