作者 刘锟

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

... ... @@ -99,16 +99,16 @@ class RemainDay extends Command
$item->remain_day = ($remain_day > 0 ? $remain_day : 0);
}
$item->save();
// if($item->remain_day == 0){
// $item->extend_type = Project::TYPE_FIVE;
if($item->remain_day == 0){
$item->extend_type = Project::TYPE_FIVE;
// $item->site_status = Project::TYPE_ONE;//关闭站点
// //TODO::未续费网站禁止登录及通知C端禁止网站
//TODO::未续费网站禁止登录及通知C端禁止网站
// $domainModel = new DomainInfoModel();
// $domainInfos = $domainModel->read(['project_id'=>$item->id]);
// if($domainInfos !== false){
// curl_get('https://'.$domainInfos['domain'].'/api/stop_or_start_website/');
// }
// }
}
}
}
}
... ...
... ... @@ -62,7 +62,7 @@ class UpdateBuildConfiguration extends Command
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['delete_status'=>0,'id'=>3050],'id',['id'],'asc');
$list = $projectModel->list(['delete_status'=>0,'id'=>1214],'id',['id'],'asc');
foreach ($list as $k => $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
... ... @@ -87,14 +87,14 @@ class UpdateBuildConfiguration extends Command
// if(($product_list > 0) && ($lists == 0)){
// echo date('Y-m-d H:i:s') . '需要处理的项目:'.$project_id . PHP_EOL;
// }
Detail::truncate();
Column::truncate();
$c = new Column();
$c->addReturnId(['column_name'=>'product detail']);
// Detail::truncate();
// Column::truncate();
// $c = new Column();
// $c->addReturnId(['column_name'=>'product detail']);
$productModel = new Product();
$page = 1;
while (true){
$lists = $productModel->lists([],$page,1,['id','content','describe']);
$lists = $productModel->lists(['id'=>361],$page,1,['id','content','describe']);
$detailModel = new Detail();
if(!empty($lists['list'])){
foreach ($lists['list'] as $k => $v){
... ... @@ -105,40 +105,40 @@ class UpdateBuildConfiguration extends Command
'column_id'=>1,
'text_type'=>1,
'title'=>'product detail',
'sort'=>1,
'sort'=>2,
'content'=>json_encode(['content'=>$v['content'] ?? ''],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s')
];
$detailModel->insert($data);
}
if(!empty($v['describe'])){
foreach ($v['describe'] as $key => $value){
if(isset($value['title']) && ($value['title'] == null)){
$value['title'] = '';
}
if(isset($value['text']) && ($value['text'] == null)){
$value['text'] = '';
}
if(empty($value['title'])){
continue;
}
//添加切换栏
$c = new Column();
$id = $c->addReturnId(['column_name'=>$value['title'],'product_id'=>$v['id']]);
$dataS = [
'product_id'=>$v['id'],
'column_id'=>$id,
'text_type'=>1,
'title'=>$value['title'] ?? '',
'sort'=>$key + 1,
'content'=>json_encode(['content'=>$value['text'] ?? ''],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s')
];
$detailModel->insert($dataS);
}
}
// if(!empty($v['describe'])){
// foreach ($v['describe'] as $key => $value){
// if(isset($value['title']) && ($value['title'] == null)){
// $value['title'] = '';
// }
// if(isset($value['text']) && ($value['text'] == null)){
// $value['text'] = '';
// }
// if(empty($value['title'])){
// continue;
// }
// //添加切换栏
// $c = new Column();
// $id = $c->addReturnId(['column_name'=>$value['title'],'product_id'=>$v['id']]);
// $dataS = [
// 'product_id'=>$v['id'],
// 'column_id'=>$id,
// 'text_type'=>1,
// 'title'=>$value['title'] ?? '',
// 'sort'=>$key + 1,
// 'content'=>json_encode(['content'=>$value['text'] ?? ''],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
// 'created_at'=>date('Y-m-d H:i:s'),
// 'updated_at'=>date('Y-m-d H:i:s')
// ];
// $detailModel->insert($dataS);
// }
// }
}
}else{
break;
... ...
... ... @@ -16,6 +16,7 @@ use App\Models\Product\Category;
use App\Models\Product\CategoryRelated;
use App\Models\Product\Keyword;
use App\Models\Product\Product;
use App\Models\Project\DeployOptimize;
use App\Models\Project\OnlineCheck;
use App\Models\Project\Project;
use App\Models\RouteMap\RouteMap;
... ... @@ -349,4 +350,28 @@ class PrivateController extends BaseController
$list = array_filter(array_unique($domain));
return $this->success($list);
}
/**
* 将项目标记为广告状态
* @param Request $request
* @return false|string
*/
public function markProjectAds(Request $request)
{
$company = trim($request->input('company_name'));
$project = Project::where(['company' => $company])->first();
if (empty($project))
return $this->error('未找到企业名称为:"' . $company . '"的项目');
$optimize = DeployOptimize::where(['project_id' => $project->id])->first();
$array = [
$optimize->special,
16
];
$array = array_unique(array_filter($array));
$string = ',' . implode(',', $array) . ',';
$optimize->special = $string;
$optimize->save();
return $this->success();
}
}
... ...
... ... @@ -931,14 +931,14 @@ class ProjectController extends BaseController
'id'=>'required',
'aicc'=>'required',
'hagro'=>'required',
'exclusive_aicc_day'=>'required',
'exclusive_hagro_day'=>'required',
// 'exclusive_aicc_day'=>'required',
// 'exclusive_hagro_day'=>'required',
],[
'id.required' => 'id不能为空',
'aicc.required' => 'aicc是否开启不能为空',
'hagro.required' => 'hagro是否开启不能为空',
'exclusive_aicc_day.required' => '服务天数不能为空',
'exclusive_hagro_day.required' => '服务天数不能为空',
// 'exclusive_aicc_day.required' => '服务天数不能为空',
// 'exclusive_hagro_day.required' => '服务天数不能为空',
]);
$logic->saveOtherProject();
$this->response('success');
... ...
... ... @@ -198,15 +198,7 @@ class LoginController extends BaseController
$arrayData = json_decode($jsonData, true);
//gh_27174ac5c9d8,gh_27174ac5c9d8
$data = $this->setWechat($arrayData['FromUserName'],$arrayData['EventKey']);
if($data['code'] == 0){//登录失败,请先绑定
$resMessage = $data['message'];
}elseif($data['code'] == 1){
$resMessage = $data['message'];
}elseif($data['code'] == 2){
$resMessage = $data['message'];
}else{
$resMessage = $data['message'];
}
$resMessage = $data['message'];
Cache::add($arrayData['Ticket'],$data,300);
return "<xml>
<ToUserName><![CDATA[$message->FromUserName]]></ToUserName>
... ...
... ... @@ -786,7 +786,7 @@ class ProjectLogic extends BaseLogic
//获取当前数据详情
$projectInfo = $this->getProjectInfo($this->param['id']);
//aicc if (($projectInfo['aicc'] == Project::TYPE_ZERO) && ($this->param['aicc'] == Project::TYPE_ONE)) 从关闭到开启状态才同步, 改成只要是开启状态就同步
if($this->param['aicc'] == Project::TYPE_ONE){
if($this->param['aicc'] == Project::TYPE_ONE && !empty($this->param['exclusive_aicc_day'])){
$data = [
'company_name'=>$projectInfo['company'],
'principal_mobile'=>$projectInfo['mobile'],
... ... @@ -798,7 +798,7 @@ class ProjectLogic extends BaseLogic
$this->toAicc($data);
}
//黑格 从关闭到开启状态才同步, 改成只要是开启状态就同步, 需要修改有效时间
if($this->param['hagro'] == Project::TYPE_ONE){
if($this->param['hagro'] == Project::TYPE_ONE && !empty($this->param['exclusive_hagro_day'])){
$data = [
'company_name'=>$projectInfo['company'],
'principal_mobile'=>$projectInfo['mobile'],
... ... @@ -809,6 +809,12 @@ class ProjectLogic extends BaseLogic
];
$this->toHagro($data);
}
if(empty($this->param['exclusive_aicc_day'])){
unset($this->param['exclusive_aicc_day']);
}
if(empty($this->param['exclusive_hagro_day'])){
unset($this->param['exclusive_hagro_day']);
}
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
if($rs === false){
$this->fail('保存失败,请联系管理员');
... ...
... ... @@ -358,9 +358,9 @@ class UserLoginLogic
'message'=>'登陆成功',
'data'=>$info
];
Common::set_user_login(['user_id'=>$info['id'],'ip'=>request()->ip(),
'project_id'=>$info['project_id'], 'type'=>2 ,'remark' => '自动登录,用户微信扫码']);
}
Common::set_user_login(['user_id'=>$info['id'],'ip'=>request()->ip(),
'project_id'=>$info['project_id'], 'type'=>2 ,'remark' => '自动登录,用户微信扫码']);
return $this->success($data);
}
... ...
... ... @@ -54,6 +54,8 @@ Route::any('get_project_product', [\App\Http\Controllers\Api\PrivateController::
// --------------------- 站群服务 ------------------------------------------
// --------------------- 监控服务 ------------------------------------------
Route::any('get_project_online', [\App\Http\Controllers\Api\PrivateController::class, 'getProjectOnline'])->name('api.get_project_online');
// 将项目标记为广告状态
Route::any('mark_project_ads', [\App\Http\Controllers\Api\PrivateController::class, 'markProjectAds'])->name('api.mark_project_ads');
//自建站接口转接
Route::post('selfSiteApi', [\App\Http\Controllers\Api\SelfSiteController::class, 'selfSiteApi']);
... ...