作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into lyh-server

<?php
namespace App\Console\Commands\Sync;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use App\Models\SyncSubmitTask\SyncSubmitTask;
/**
* 渠道信息
* Class ChannelInfo
* @package App\Console\Commands
* @author zbj
* @date 2023/6/27
*/
class SyncChinaLog extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'sync_china_log';
/**
* The console command description.
*
* @var string
*/
protected $description = '同步国内数据库访问及询盘';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
public function handle()
{
$list = DB::connection('mysql_sh')->table('gl_sync_submit_task')->where('status', 0)->limit(20)->get();
$insert = [];
$ids = [];
foreach ($list as $item) {
$ids[] = $item->id;
$insert[] = [
'type' => $item->type,
'data' => $item->data,
'created_at' => $item->created_at,
'updated_at' => $item->updated_at,
];
}
DB::connection('mysql_sh')->table('gl_sync_submit_task')->whereIn('id', $ids)->update(['status' => 1]);
SyncSubmitTask::insert($insert);
}
}
... ...
... ... @@ -43,14 +43,17 @@ class ProjectCountryController extends BaseController
public function custom_save(DomainInfoLogic $domainInfoLogic){
$this->request->validate([
'language_id'=>'required',
'custom_domain'=>'required',
'is_create'=>'required'
],[
'language_id.required' => 'language_id不能为空',
'custom_domain.required' => 'custom_domain不能为空',
'is_create.required' => 'is_create不能为空'
]);
$domainInfoLogic->country_custom($this->user['project_id']);
if(isset($this->param['custom_domain']) && $this->param['custom_domain']){
$domainInfoLogic->country_custom($this->user['project_id']);
}else{
$projectCountryLogic = new ProjectCountryLogic();
$projectCountryLogic->country_custom_del();
}
$this->response('success');
}
... ...
... ... @@ -170,6 +170,26 @@ return [
'prefix_indexes' => true,
],
'mysql_sh' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_SH_HOST', '127.0.0.1'),
'port' => env('DB_SH_PORT', '3306'),
'database' => env('DB_SH_DATABASE', 'forge'),
'username' => env('DB_SH_USERNAME', 'forge'),
'password' => env('DB_SH_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
],
/*
... ...