作者 刘锟

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

... ... @@ -55,7 +55,7 @@ class UpdateRoute extends Command
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['id'=>23]);
$list = $projectModel->list(['id'=>249]);
$data = [];
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
... ...
... ... @@ -430,7 +430,7 @@ class WebTrafficRussia extends Command
$data = [];
for ($i=0;$i<$num;$i++){
//ip国家占比
$ip_area = $this->get_rand($this->country_ratio);
$ip_area = $this->get_rand($country_ratio);
$res = DB::table('gl_xunpan_ipdata')->where('ip_area', $ip_area)->inRandomOrder()->first();
$res = (array)$res;
$res['diff'] = $time_zones[$res['ip_area']];
... ...
... ... @@ -10,6 +10,8 @@
namespace App\Http\Logic\Bside\Setting;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Com\UpdateLog;
use App\Models\User\UserLog;
use App\Models\WebSetting\Translate as TranslateModel;
use App\Models\WebSetting\WebLanguage;
use App\Helper\Translate;
... ... @@ -271,9 +273,10 @@ class TranslateLogic extends BaseLogic
}
}
}
$this->param['data'] = $data;
}
try {
$info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]);
$info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]);
if($info === false){
$param = [
'type'=>$this->param['type'],
... ... @@ -285,9 +288,14 @@ class TranslateLogic extends BaseLogic
$param['data'] = json_encode($data,JSON_UNESCAPED_UNICODE);
$this->model->add($param);
}else{
$data = json_encode($data,JSON_UNESCAPED_UNICODE);
$this->model->edit(['data'=>$data],['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]);
if(!empty($data)){
$data = json_encode($data,JSON_UNESCAPED_UNICODE);
$this->model->edit(['data'=>$data],['language_id'=>$this->param['language_id'],'project_id'=>$this->user['project_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]);
}
}
//写日志
$userLogModel = new UserLog();
$userLogModel->add(['model'=>'translate/save','remark'=>json_encode($this->param,true),'type'=>0,'operator_id'=>$this->user['id'],'project_id'=>$this->user['project_id']]);
}catch (\Exception $e){
$this->fail('系统错误请联系管理员');
}
... ...