合并分支 'lyh-server' 到 'master'
gxai设置banner 查看合并请求 !1966
正在显示
4 个修改的文件
包含
42 行增加
和
2 行删除
| @@ -10,11 +10,14 @@ | @@ -10,11 +10,14 @@ | ||
| 10 | namespace App\Console\Commands\LyhTest; | 10 | namespace App\Console\Commands\LyhTest; |
| 11 | 11 | ||
| 12 | use App\Console\Commands\Domain\DomainInfo; | 12 | use App\Console\Commands\Domain\DomainInfo; |
| 13 | +use App\Models\Ai\AiBlogAuthor; | ||
| 13 | use App\Models\Com\NoticeLog; | 14 | use App\Models\Com\NoticeLog; |
| 14 | use App\Models\Project\AiBlogTask; | 15 | use App\Models\Project\AiBlogTask; |
| 15 | use App\Models\Project\DeployBuild; | 16 | use App\Models\Project\DeployBuild; |
| 16 | use App\Models\Project\OnlineCheck; | 17 | use App\Models\Project\OnlineCheck; |
| 17 | use App\Models\Project\Project; | 18 | use App\Models\Project\Project; |
| 19 | +use App\Models\WebSetting\WebSetting; | ||
| 20 | +use App\Services\ProjectServer; | ||
| 18 | use Illuminate\Console\Command; | 21 | use Illuminate\Console\Command; |
| 19 | use Illuminate\Support\Facades\Artisan; | 22 | use Illuminate\Support\Facades\Artisan; |
| 20 | use Illuminate\Support\Facades\DB; | 23 | use Illuminate\Support\Facades\DB; |
| @@ -36,7 +39,21 @@ class lyhDemo extends Command | @@ -36,7 +39,21 @@ class lyhDemo extends Command | ||
| 36 | protected $description = '更新路由'; | 39 | protected $description = '更新路由'; |
| 37 | 40 | ||
| 38 | public function handle(){ | 41 | public function handle(){ |
| 39 | - return true; | 42 | + $projectModel = new Project(); |
| 43 | + $lists = $projectModel->list(['delete_status' => 0,'extend_type'=>0,'type'=>['in',[1,2,3,4]]], 'id', ['id']); | ||
| 44 | + foreach ($lists as $val) { | ||
| 45 | +// echo date('Y-m-d H:i:s') . '开始--项目的id:'. $val['id'] . PHP_EOL; | ||
| 46 | + ProjectServer::useProject($val['id']); | ||
| 47 | + try { | ||
| 48 | + $settingModel = new WebSetting(); | ||
| 49 | + $settingModel->edit(['']); | ||
| 50 | + }catch (\Exception $e){ | ||
| 51 | + | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + DB::disconnect('custom_mysql'); | ||
| 55 | + } | ||
| 56 | + return true; | ||
| 40 | } | 57 | } |
| 41 | 58 | ||
| 42 | } | 59 | } |
| @@ -13,6 +13,7 @@ use App\Enums\Common\Code; | @@ -13,6 +13,7 @@ use App\Enums\Common\Code; | ||
| 13 | use App\Helper\Arr; | 13 | use App\Helper\Arr; |
| 14 | use App\Http\Controllers\Bside\BaseController; | 14 | use App\Http\Controllers\Bside\BaseController; |
| 15 | use App\Models\WebSetting\AggregationSetting; | 15 | use App\Models\WebSetting\AggregationSetting; |
| 16 | +use App\Models\WebSetting\WebSettingImage; | ||
| 16 | 17 | ||
| 17 | /** | 18 | /** |
| 18 | * @remark :聚合页 | 19 | * @remark :聚合页 |
| @@ -58,6 +59,19 @@ class AggregationSettingController extends BaseController | @@ -58,6 +59,19 @@ class AggregationSettingController extends BaseController | ||
| 58 | public function edit(){ | 59 | public function edit(){ |
| 59 | $aggSettingModel = new AggregationSetting(); | 60 | $aggSettingModel = new AggregationSetting(); |
| 60 | if(isset($this->param['top_banner']) && !empty($this->param['top_banner'])){ | 61 | if(isset($this->param['top_banner']) && !empty($this->param['top_banner'])){ |
| 62 | + $number = count($this->param['top_banner']); | ||
| 63 | + //查询ai——blog是否拥有banner图 | ||
| 64 | + $settingImageModel = new WebSettingImage(); | ||
| 65 | + $info = $settingImageModel->read(['type'=>4]); | ||
| 66 | + if($info === false){ | ||
| 67 | + $settingImageModel->addReturnId(['type'=>4,'project_id'=>$this->user['project_id'],'image'=>reset($this->param['top_banner'])]); | ||
| 68 | + if($number > 1){ | ||
| 69 | + $this->param['top_banner'] = array_slice($this->param['top_banner'], 1); | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + if($number > 3){ | ||
| 73 | + $this->param['top_banner'] = array_slice($this->param['top_banner'], 0, 3); | ||
| 74 | + } | ||
| 61 | $this->param['top_banner'] = Arr::a2s($this->param['top_banner']); | 75 | $this->param['top_banner'] = Arr::a2s($this->param['top_banner']); |
| 62 | } | 76 | } |
| 63 | if(isset($this->param['foot_banner']) && !empty($this->param['foot_banner'])){ | 77 | if(isset($this->param['foot_banner']) && !empty($this->param['foot_banner'])){ |
| @@ -23,7 +23,7 @@ class WebSettingImageController extends BaseController | @@ -23,7 +23,7 @@ class WebSettingImageController extends BaseController | ||
| 23 | * @time :2023/9/21 15:12 | 23 | * @time :2023/9/21 15:12 |
| 24 | */ | 24 | */ |
| 25 | public function lists(WebSettingImage $webSettingImage){ | 25 | public function lists(WebSettingImage $webSettingImage){ |
| 26 | - $list = $webSettingImage->list([],'id',['id','image','type']); | 26 | + $list = $webSettingImage->list($this->map,'id',['id','image','type']); |
| 27 | foreach ($list as $k=>$v){ | 27 | foreach ($list as $k=>$v){ |
| 28 | $v['image'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']); | 28 | $v['image'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']); |
| 29 | $list[$k] = $v; | 29 | $list[$k] = $v; |
| @@ -17,4 +17,13 @@ class WebSettingImage extends Base | @@ -17,4 +17,13 @@ class WebSettingImage extends Base | ||
| 17 | 17 | ||
| 18 | //连接数据库 | 18 | //连接数据库 |
| 19 | protected $connection = 'custom_mysql'; | 19 | protected $connection = 'custom_mysql'; |
| 20 | + | ||
| 21 | + public function imageMap(){ | ||
| 22 | + return [ | ||
| 23 | + 1 => '产品', | ||
| 24 | + 2 => '博客', | ||
| 25 | + 3 => '新闻', | ||
| 26 | + 4 => 'ai_blog' | ||
| 27 | + ]; | ||
| 28 | + } | ||
| 20 | } | 29 | } |
-
请 注册 或 登录 后发表评论