上传接口
This commit is contained in:
parent
5f13387985
commit
f256e76153
@ -116,7 +116,31 @@ class PublicController
|
||||
*/
|
||||
public function getSiteConfig()
|
||||
{
|
||||
$data['record_No'] = sys_config('record_No');
|
||||
// $data['record_No'] = sys_config('record_No');
|
||||
$data['site_name'] = sys_config("site_name");
|
||||
|
||||
|
||||
$data['official_website_logo'] = sys_config("official_website_logo");
|
||||
$data['company_name'] = sys_config("company_name");
|
||||
$data['record_number'] = sys_config("record_number");
|
||||
$data['official_contact_qr_code'] = sys_config("official_contact_qr_code");
|
||||
$data['official_website_address'] = sys_config("official_website_address");
|
||||
$data['luoyang_sales_hotline'] = sys_config("luoyang_sales_hotline");
|
||||
$data['website_construction_and_development_consulting'] = sys_config("website_construction_and_development_consulting");
|
||||
$data['internet_network_security_hosting'] = sys_config("internet_network_security_hosting");
|
||||
$data['internet_marketing_consulting'] = sys_config("internet_marketing_consulting");
|
||||
$data['new_media_wechat_public_number'] = sys_config("new_media_wechat_public_number");
|
||||
$data['new_media_tiktok_short_video_operation'] = sys_config("new_media_tiktok_short_video_operation");
|
||||
$data['internet_big_data_public_opinion'] = sys_config("internet_big_data_public_opinion");
|
||||
|
||||
$data['recruitment_training'] = sys_config("recruitment_training");
|
||||
$data['luoyang_company_address'] = sys_config("luoyang_company_address");
|
||||
$data['zhengzhou_company_address'] = sys_config("zhengzhou_company_address");
|
||||
|
||||
$data['technical_center_address'] = sys_config("technical_center_address");
|
||||
$data['name_of_company_and_subsidiary'] = sys_config("name_of_company_and_subsidiary");
|
||||
$data['legal_adviser'] = sys_config("legal_adviser");
|
||||
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\api\controller\v1\publics;
|
||||
|
||||
use app\services\article\ArticleCategoryServices;
|
||||
use crmeb\services\CacheService;
|
||||
|
||||
/**
|
||||
* 文章分类类
|
||||
* Class ArticleCategoryController
|
||||
* @package app\api\controller\publics
|
||||
*/
|
||||
class ArticleCategoryController
|
||||
{
|
||||
protected $services;
|
||||
|
||||
public function __construct(ArticleCategoryServices $services)
|
||||
{
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章分类列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lst()
|
||||
{
|
||||
$cateInfo = CacheService::remember('ARTICLE_CATEGORY', function () {
|
||||
$cateInfo = $this->services->getArticleCategory();
|
||||
array_unshift($cateInfo, ['id' => 0, 'title' => '热门']);
|
||||
return $cateInfo;
|
||||
});
|
||||
return app('json')->success($cateInfo);
|
||||
}
|
||||
}
|
120
crmeb/app/api/controller/v1/publics/ArticleController.php
Normal file
120
crmeb/app/api/controller/v1/publics/ArticleController.php
Normal file
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\api\controller\v1\publics;
|
||||
|
||||
use app\services\article\ArticleServices;
|
||||
|
||||
/**
|
||||
* 文章类
|
||||
* Class ArticleController
|
||||
* @package app\api\controller\publics
|
||||
*/
|
||||
class ArticleController
|
||||
{
|
||||
protected $services;
|
||||
|
||||
public function __construct(ArticleServices $services)
|
||||
{
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章列表
|
||||
* @param $cid
|
||||
* @return mixed
|
||||
* @throws \ReflectionException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function lst($cid)
|
||||
{
|
||||
if ($cid == 0) {
|
||||
$where = ['is_hot' => 1];
|
||||
} else {
|
||||
$where = ['cid' => $cid];
|
||||
}
|
||||
[$page, $limit] = $this->services->getPageValue();
|
||||
$list = $this->services->getList($where, $page, $limit)['list'];
|
||||
foreach ($list as &$item){
|
||||
$item['add_time'] = date('Y-m-d H:i', $item['add_time']);
|
||||
}
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章详情
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws \ReflectionException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function details($id)
|
||||
{
|
||||
$info = $this->services->getInfo($id);
|
||||
return app('json')->success($info);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取热门文章
|
||||
* @return mixed
|
||||
* @throws \ReflectionException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function hot()
|
||||
{
|
||||
[$page, $limit] = $this->services->getPageValue();
|
||||
$list = $this->services->getList(['is_hot' => 1], $page, $limit)['list'];
|
||||
foreach ($list as &$item){
|
||||
$item['add_time'] = date('Y-m-d H:i', $item['add_time']);
|
||||
}
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* @throws \ReflectionException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function new()
|
||||
{
|
||||
[$page, $limit] = $this->services->getPageValue();
|
||||
$list = $this->services->getList([], $page, $limit)['list'];
|
||||
foreach ($list as &$item){
|
||||
$item['add_time'] = date('Y-m-d H:i', $item['add_time']);
|
||||
}
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取顶部banner文章
|
||||
* @return mixed
|
||||
* @throws \ReflectionException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function banner()
|
||||
{
|
||||
[$page, $limit] = $this->services->getPageValue();
|
||||
$list = $this->services->getList(['is_banner' => 1], $page, $limit)['list'];
|
||||
foreach ($list as &$item){
|
||||
$item['add_time'] = date('Y-m-d H:i', $item['add_time']);
|
||||
}
|
||||
return app('json')->success($list);
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\api\controller\v1\publics;
|
||||
|
||||
use app\services\caseinfo\CaseCategoryServices;
|
||||
use crmeb\services\CacheService;
|
||||
|
||||
/**
|
||||
* 案例分类类
|
||||
* Class ArticleCategoryController
|
||||
* @package app\api\controller\publics
|
||||
*/
|
||||
class CaseCategoryController
|
||||
{
|
||||
protected $services;
|
||||
|
||||
public function __construct(CaseCategoryServices $services)
|
||||
{
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 案例分类列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function lst()
|
||||
{
|
||||
$cateInfo = CacheService::remember('ARTICLE_CATEGORY', function () {
|
||||
$cateInfo = $this->services->getArticleCategory();
|
||||
array_unshift($cateInfo, ['id' => 0, 'title' => '热门']);
|
||||
return $cateInfo;
|
||||
});
|
||||
return app('json')->success($cateInfo);
|
||||
}
|
||||
}
|
145
crmeb/app/api/controller/v1/publics/CaseController.php
Normal file
145
crmeb/app/api/controller/v1/publics/CaseController.php
Normal file
@ -0,0 +1,145 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\api\controller\v1\publics;
|
||||
|
||||
use app\services\caseinfo\CaseServices;
|
||||
|
||||
/**
|
||||
* 案例类
|
||||
* Class ArticleController
|
||||
* @package app\api\controller\publics
|
||||
*/
|
||||
class CaseController
|
||||
{
|
||||
protected $services;
|
||||
|
||||
public function __construct(CaseServices $services)
|
||||
{
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 案例列表
|
||||
* @param $cid
|
||||
* @return mixed
|
||||
* @throws \ReflectionException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function lst($cid)
|
||||
{
|
||||
if ($cid == 0) {
|
||||
$where = ['is_hot' => 1];
|
||||
} else {
|
||||
$where = ['cid' => $cid];
|
||||
}
|
||||
[$page, $limit] = $this->services->getPageValue();
|
||||
$list = $this->services->getList($where, $page, $limit)['list'];
|
||||
foreach ($list as &$item){
|
||||
$item['add_time'] = date('Y-m-d H:i', $item['add_time']);
|
||||
}
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 案例详情
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws \ReflectionException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function details($id)
|
||||
{
|
||||
$info = $this->services->getInfo($id);
|
||||
return app('json')->success($info);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取热门案例
|
||||
* @return mixed
|
||||
* @throws \ReflectionException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function hot()
|
||||
{
|
||||
[$page, $limit] = $this->services->getPageValue();
|
||||
$list = $this->services->getList(['is_hot' => 1], $page, $limit)['list'];
|
||||
foreach ($list as &$item){
|
||||
$item['add_time'] = date('Y-m-d H:i', $item['add_time']);
|
||||
}
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* @throws \ReflectionException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function new()
|
||||
{
|
||||
[$page, $limit] = $this->services->getPageValue();
|
||||
$list = $this->services->getList([], $page, $limit)['list'];
|
||||
foreach ($list as &$item){
|
||||
$item['add_time'] = date('Y-m-d H:i', $item['add_time']);
|
||||
}
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取顶部banner案例
|
||||
* @return mixed
|
||||
* @throws \ReflectionException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function banner()
|
||||
{
|
||||
[$page, $limit] = $this->services->getPageValue();
|
||||
$list = $this->services->getList(['is_banner' => 1], $page, $limit)['list'];
|
||||
foreach ($list as &$item){
|
||||
$item['add_time'] = date('Y-m-d H:i', $item['add_time']);
|
||||
}
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 官网客户见证数据
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function customer_witness()
|
||||
{
|
||||
$customer_witness = sys_data('customer_witness') ?? [];
|
||||
// $searchKeyword = [];
|
||||
// if (count($routineHotSearch)) {
|
||||
// foreach ($routineHotSearch as $key => &$item) {
|
||||
// array_push($searchKeyword, $item['title']);
|
||||
// }
|
||||
// }
|
||||
return app('json')->success($customer_witness);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
62
crmeb/app/api/controller/v1/publics/ProcessController.php
Normal file
62
crmeb/app/api/controller/v1/publics/ProcessController.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* 公司历程
|
||||
* @author crud自动生成代码
|
||||
* @date 2025/02/21
|
||||
*/
|
||||
|
||||
namespace app\api\controller\v1\publics;
|
||||
|
||||
use think\facade\App;
|
||||
use app\services\crud\ProcessServices;
|
||||
|
||||
/**
|
||||
* Class Process
|
||||
* @date 2025/02/21
|
||||
* @package app\adminapi\controller\crud
|
||||
*/
|
||||
class ProcessController
|
||||
{
|
||||
|
||||
/**
|
||||
* @var ProcessServices
|
||||
*/
|
||||
protected $service;
|
||||
|
||||
/**
|
||||
* ProcessController constructor.
|
||||
* @param ProcessServices $service
|
||||
*/
|
||||
public function __construct(ProcessServices $service)
|
||||
{
|
||||
|
||||
$this->service = $service;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* @date 2025/02/21
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function lst()
|
||||
{
|
||||
$where = [];
|
||||
return app('json')->success($this->service->getCrudListIndex($where));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -26,3 +26,57 @@ Route::miss(function () {
|
||||
} else
|
||||
return Response::create()->code(404);
|
||||
});
|
||||
|
||||
|
||||
//未授权接口
|
||||
Route::group(function () {
|
||||
|
||||
Route::group(function () {
|
||||
|
||||
//公共类
|
||||
Route::get('site_config', 'v1.PublicController/getSiteConfig')->name('getSiteConfig')->option(['real_name' => '获取网站配置']);//获取网站配置
|
||||
|
||||
})->option(['mark' => 'index', 'mark_name' => '主页接口']);
|
||||
|
||||
Route::group(function () {
|
||||
|
||||
Route::group(function () {
|
||||
//文章分类类
|
||||
Route::get('article/category/list', 'v1.publics.ArticleCategoryController/lst')->name('articleCategoryList')->option(['real_name' => '文章分类列表']);//文章分类列表
|
||||
//文章类
|
||||
Route::get('article/list/:cid', 'v1.publics.ArticleController/lst')->name('articleList')->option(['real_name' => '文章列表']);//文章列表
|
||||
Route::get('article/details/:id', 'v1.publics.ArticleController/details')->name('articleDetails')->option(['real_name' => '文章详情']);//文章详情
|
||||
Route::get('article/hot/list', 'v1.publics.ArticleController/hot')->name('articleHotList')->option(['real_name' => '文章 热门']);//文章 热门
|
||||
Route::get('article/new/list', 'v1.publics.ArticleController/new')->name('articleNewList')->option(['real_name' => '文章 最新']);//文章 最新
|
||||
Route::get('article/banner/list', 'v1.publics.ArticleController/banner')->name('articleBannerList')->option(['real_name' => '文章 banner']);//文章 banner
|
||||
})->option(['parent' => 'activity_nologin', 'cate_name' => '文章(未授权)']);
|
||||
|
||||
|
||||
Route::group(function () {
|
||||
//案例分类类
|
||||
Route::get('caseinfo/category/list', 'v1.publics.CaseCategoryController/lst')->name('caseCategoryController')->option(['real_name' => '案例分类列表']);//文章分类列表
|
||||
//案例类
|
||||
Route::get('caseinfo/list/:cid', 'v1.publics.CaseController/lst')->name('caseList')->option(['real_name' => '案例列表']);//文章列表
|
||||
Route::get('caseinfo/details/:id', 'v1.publics.CaseController/details')->name('caseDetails')->option(['real_name' => '案例详情']);//文章详情
|
||||
Route::get('caseinfo/hot/list', 'v1.publics.CaseController/hot')->name('caseHotList')->option(['real_name' => '案例 热门']);//文章 热门
|
||||
Route::get('caseinfo/new/list', 'v1.publics.CaseController/new')->name('caseNewList')->option(['real_name' => '案例 最新']);//文章 最新
|
||||
Route::get('caseinfo/banner/list', 'v1.publics.CaseController/banner')->name('caseBannerList')->option(['real_name' => '案例 banner']);//文章 banner
|
||||
|
||||
Route::get('caseinfo/customer', 'v1.publics.CaseController/customer_witness')->name('caseCustomer')->option(['real_name' => '官网客户见证数据列表']);//文章分类列表
|
||||
|
||||
})->option(['parent' => 'caseinfo', 'cate_name' => '案例(未授权)']);
|
||||
|
||||
|
||||
|
||||
Route::group(function () {
|
||||
//公司历程
|
||||
Route::get('process/list', 'v1.publics.ProcessController/lst')->name('processList')->option(['real_name' => '公司历程列表']);//文章列表
|
||||
|
||||
})->option(['parent' => 'activity_nologin', 'cate_name' => '公司历程']);
|
||||
|
||||
})->option(['mark' => 'web_site_info', 'mark_name' => '官网']);
|
||||
|
||||
|
||||
})->middleware(\app\http\middleware\AllowOriginMiddleware::class)
|
||||
->middleware(\app\api\middleware\StationOpenMiddleware::class)
|
||||
->middleware(\app\api\middleware\AuthTokenMiddleware::class, false);
|
Loading…
x
Reference in New Issue
Block a user