作者 赵彬吉

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

... ... @@ -127,53 +127,53 @@ class ComController extends BaseController
* @method :post
* @time :2023/5/12 14:55
*/
// protected function ceShi(){
// $this->error = 0;
// //获取所有ayr_share用户
// $ayr_share_model = new AyrShareModel();
// $ayr_share_list = $ayr_share_model->list($this->map);
// if(!empty($ayr_share_list)){
// foreach ($ayr_share_list as $k => $v){
// //查询当前用户是否有未推送的博文
// $ayr_release = new AyrReleaseModel();
// $release_info = $ayr_release->read(['schedule_date'=>['>',date('Y-m-d H:i:s',time())],'share_id'=>$v['id']]);
// //有推文时,直接跳出循环
// if($release_info !== false){
// continue;
// }
// //查看用户是否在一周内有发送博客
// $start_at = Carbon::now()->modify('-7 days')->toDateString();
// $end_at = Carbon::now()->toDateString();
// $release_info = $ayr_release->read(['created_at'=>['between',[$start_at,$end_at]]]);
// //有发送博文,则跳出循环
// if($release_info == false){
// continue;
// }
// //删除用户第三方配置
// $ayr_share_helper = new AyrShareHelper();
// $data_profiles = [
// 'title'=>$v['title'],
// 'profileKey'=>$v['profile_key']
// ];
// $res = $ayr_share_helper->deleted_profiles($data_profiles);
// if($res['status'] == 'fail'){
// $this->error++;
// continue;
// }
// //更新数据库
// $data = [
// 'title'=>null,
// 'bind_plat_from'=>null,
// 'profile_key'=>null,
// 'ref_id'=>null,
// ];
// $res = $ayr_share_model->edit($data,['id'=>$v['id']]);
// if($res == false){
// $this->error++;
// }
// }
// }
// return $this->error;
// }
protected function ceShi(){
$this->error = 0;
//获取所有ayr_share用户
$ayr_share_model = new AyrShareModel();
$ayr_share_list = $ayr_share_model->list($this->map);
if(!empty($ayr_share_list)){
foreach ($ayr_share_list as $k => $v){
//查询当前用户是否有未推送的博文
$ayr_release = new AyrReleaseModel();
$release_info = $ayr_release->read(['schedule_date'=>['>',date('Y-m-d H:i:s',time())],'share_id'=>$v['id']]);
//有推文时,直接跳出循环
if($release_info !== false){
continue;
}
//查看用户是否在一周内有发送博客
$start_at = Carbon::now()->modify('-7 days')->toDateString();
$end_at = Carbon::now()->toDateString();
$release_info = $ayr_release->read(['created_at'=>['between',[$start_at,$end_at]]]);
//有发送博文,则跳出循环
if($release_info == false){
continue;
}
//删除用户第三方配置
$ayr_share_helper = new AyrShareHelper();
$data_profiles = [
'title'=>$v['title'],
'profileKey'=>$v['profile_key']
];
$res = $ayr_share_helper->deleted_profiles($data_profiles);
if($res['status'] == 'fail'){
$this->error++;
continue;
}
//更新数据库
$data = [
'title'=>null,
'bind_plat_from'=>null,
'profile_key'=>null,
'ref_id'=>null,
];
$res = $ayr_share_model->edit($data,['id'=>$v['id']]);
if($res == false){
$this->error++;
}
}
}
return $this->error;
}
}
... ...
... ... @@ -122,8 +122,90 @@ class TemplateController extends BaseController
$data = TemplateLogic::instance()->first($source,$source_id);
return $this->response('',Code::SUCCESS,$data['html']);
$def = '<div class=" d-flex align-items-center justify-content-between py-md-4">
<div class="logo w-25 w-sm-auto"><a href="#"><img class="img-fluid" src="img/logo.png" alt=""></a></div>
<nav class="navbar navbar-expand-md navbar-dark flex-fill justify-content-end mx-2 pe-md-5">
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#navMenu"
aria-controls="navMenu">
<span class="navbar-toggler-icon"></span>
</button>
<ul class="nav column-gap-5 justify-content-end text-white d-none d-md-flex">
<li><a href="#">Home</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-bs-toggle="dropdown">Products</a>
<ul class="dropdown-menu fs-6 text-body shadow-sm border-0">
<li><a href="#" class="dropdown-item py-2">Product Information</a></li>
<li><a href="#" class="dropdown-item py-2">Change of Insurance</a></li>
<li><a href="#" class="dropdown-item py-2">Traveling Oxygen Program</a></li>
<li><a href="#" class="dropdown-item py-2">Contact</a></li>
</ul>
</li>
<li><a href="#">News</a></li>
<li><a href="#">Download</a></li>
<li><a href="#">FAQ</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
<div class="d-flex align-items-center justify-content-end">
<div class="search">
<button type="button" class="btn border-0" data-bs-toggle="dropdown">
<svg viewBox="0 0 24 24" width="18" height="18" stroke="#ffffff" stroke-width="2"
fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
</button>
<div class="dropdown-menu p-3 shadow-sm border-0">
<form action="">
<div class="d-flex mb-2">
<input type="text" class="form-control" name="search" placeholder="Start Typing...">
<button class="btn btn-search border-0" type="submit">
<svg viewBox="0 0 24 24" width="18" height="18" stroke="#333333"
stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"
class="css-i6dzq1">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
</button>
</div>
<p class="search-attr">Hit enter to search or ESC to close</p>
</form>
</div>
</div>
<div class="change-language ms-md-4">
<div role="button" class="dropdown-toggle text-white d-flex align-items-center"
data-bs-toggle="dropdown">
<b class="country-flag language-flag-en"></b> <span>English</span>
</div>
<div class="dropdown-menu shadow-sm border-0">
<div class="d-flex flex-wrap p-3 text-body">
<a href="#" class="col-4 mb-3 pe-2 d-flex align-items-center" title="English">
<b class="country-flag language-flag-en"></b>
<span>English</span>
</a>
<a href="#" class="col-4 mb-3 pe-2 d-flex align-items-center" title="Françai">
<b class="country-flag language-flag-fr"></b>
<span>Françai</span>
</a>
<a href="#" class="col-4 mb-3 pe-2 d-flex align-items-center" title="Español">
<b class="country-flag language-flag-es"></b>
<span>Español</span>
</a>
<a href="#" class="col-4 mb-3 pe-2 d-flex align-items-center" title="Deutsch">
<b class="country-flag language-flag-de"></b>
<span>Deutsch</span>
</a>
<a href="#" class="col-4 mb-3 pe-2 d-flex align-items-center" title="Română">
<b class="country-flag language-flag-ro"></b>
<span>Română</span>
</a>
</div>
</div>
</div>
</div>
</div>';
return $this->response('',Code::SUCCESS,$data?$data['html']:$def);
}
... ... @@ -174,33 +256,33 @@ class TemplateController extends BaseController
* @time 2023/5/10 14:55
*/
public function customChunk(){
$html = $this->param['html']??[];
// 那个页面 的
$type = $this->param['type']??'';
if(!is_array($html)){
return $this->response('参数异常',Code::SYSTEM_ERROR);
}
// 项目id
$project_id = $this->user['project_id'];
// 当前模板
$template_id = BSetting::_get($project_id)['template_id'];
// 验证这个模板是否存在
if(!$type || !ATemplateHtml::_typeExist($template_id,$type)){
return $this->response('页面类型错误',Code::SYSTEM_ERROR);
}
$html = view("template.{$template_id}.{$type}")->render();
return $this->response('',Code::SUCCESS,$html);
// $data = BTemplateData::_insert();
//
// $html = $this->param['html']??[];
// // 那个页面 的
// $type = $this->param['type']??'';
//
// if(!is_array($html)){
// return $this->response('参数异常',Code::SYSTEM_ERROR);
// }
//
// // 项目id
// $project_id = $this->user['project_id'];
// // 当前模板
// $template_id = BSetting::_get($project_id)['template_id'];
//
// // 验证这个模板是否存在
// if(!$type || !ATemplateHtml::_typeExist($template_id,$type)){
// return $this->response('页面类型错误',Code::SYSTEM_ERROR);
// }
//
//
// $html = view("template.{$template_id}.{$type}")->render();
//
//
// return $this->response('',Code::SUCCESS,$html);
//// $data = BTemplateData::_insert();
//
//
}
... ...
... ... @@ -40,7 +40,9 @@ class AyrReleaseLogic extends BaseLogic
public function release_add(){
$this->param['project_id'] = $this->user['project_id'];
$this->param['operator_id'] = $this->user['id'];
if(isset($this->param['images']) && !empty($this->param['images'])){
$this->param['images'] = implode(',',$this->param['images']);
}
$this->param['platforms'] = json_encode($this->param['platforms']);
$rs = $this->model->add($this->param);
if($rs === false){
... ...
... ... @@ -213,10 +213,12 @@ class AyrShareLogic extends BaseLogic
$this->fail('不支持视频');
}
//验证图片数
if(isset($this->param['images']) && !empty($this->param['images'])){
$img_num = count($this->param['images']);
if($img_num > $this->send_num[$v]){
$this->fail('发布图片数量超过最大限制,'.$v.'只允许'.$this->send_num[$v].'张图');
}
}
//验证图片数
// $img_num = count($this->param['video']);
// if($img_num > 1){
... ...
... ... @@ -2,6 +2,9 @@
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Closure;
class AccessToken
{
/**
... ...
... ... @@ -24,12 +24,9 @@ class AyrReleaseRequest extends FormRequest
{
return [
'title'=>'required',
// 'images'=>'required|array',
// 'video'=>'required',
'content'=>'required',
'share_id'=>'required',
'platforms'=>'required|array',
// 'schedule_date'=>'required',
];
}
... ...
... ... @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Route;
//必须登录验证的路由组
Route::middleware(['bloginauth'])->group(function () {
Route::middleware(['bloginauth','accesstoken'])->group(function () {
//登录用户编辑个人资料
Route::any('/edit_info', [\App\Http\Controllers\Bside\ComController::class, 'edit_info'])->name('edit_info');
Route::any('/logout', [\App\Http\Controllers\Bside\ComController::class, 'logout'])->name('logout');
... ...