作者 刘锟

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

@@ -43,13 +43,13 @@ class TemplateLog extends Command @@ -43,13 +43,13 @@ class TemplateLog extends Command
43 } 43 }
44 44
45 public function handle(){ 45 public function handle(){
  46 + $this->deleteUserLog();
46 $projectModel = new Project(); 47 $projectModel = new Project();
47 $list = $projectModel->list(['delete_status'=>0]); 48 $list = $projectModel->list(['delete_status'=>0]);
48 foreach ($list as $v){ 49 foreach ($list as $v){
49 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; 50 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
50 ProjectServer::useProject($v['id']); 51 ProjectServer::useProject($v['id']);
51 $this->deleteTemplate(); 52 $this->deleteTemplate();
52 - $this->deleteUserLog();  
53 DB::disconnect('custom_mysql'); 53 DB::disconnect('custom_mysql');
54 } 54 }
55 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 55 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
@@ -138,10 +138,11 @@ class RecommendedSuppliers extends Command @@ -138,10 +138,11 @@ class RecommendedSuppliers extends Command
138 $v['email'] = json_encode($v['email'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); 138 $v['email'] = json_encode($v['email'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
139 $v['mobile'] = json_encode($v['mobile'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); 139 $v['mobile'] = json_encode($v['mobile'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
140 $v['social_media'] = json_encode($v['social_media'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); 140 $v['social_media'] = json_encode($v['social_media'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
  141 + $v['image'] = str_replace('admin.hagro.cn','fob.ai.cc',$v['image']);
141 // $v['created_at'] = date('Y-m-d H:i:s'); 142 // $v['created_at'] = date('Y-m-d H:i:s');
142 // $v['updated_at'] = $v['created_at']; 143 // $v['updated_at'] = $v['created_at'];
143 $param = $v; 144 $param = $v;
144 - $info = $purchaserInfoModel->read(['keyword'=>$keyword,'buyer'=>$v['buyer'],'project_id'=>$project_id],['id']); 145 + $info = $purchaserInfoModel->read(['keyword'=>$keyword,'buyer_id'=>$v['buyer_id'],'project_id'=>$project_id],['id']);
145 if($info === false){ 146 if($info === false){
146 $purchaserInfoModel->add($param); 147 $purchaserInfoModel->add($param);
147 } 148 }
@@ -30,6 +30,7 @@ use App\Models\Product\Product; @@ -30,6 +30,7 @@ use App\Models\Product\Product;
30 use App\Models\Project\DeployOptimize; 30 use App\Models\Project\DeployOptimize;
31 use App\Models\Project\MinorLanguages; 31 use App\Models\Project\MinorLanguages;
32 use App\Models\Project\Project; 32 use App\Models\Project\Project;
  33 +use App\Models\Purchaser\Purchaser;
33 use App\Models\Purchaser\PurchaserInfo; 34 use App\Models\Purchaser\PurchaserInfo;
34 use App\Models\RouteMap\RouteMap; 35 use App\Models\RouteMap\RouteMap;
35 use App\Models\Template\BCustomTemplate; 36 use App\Models\Template\BCustomTemplate;
@@ -60,14 +61,15 @@ class Demo extends Command @@ -60,14 +61,15 @@ class Demo extends Command
60 protected $description = 'demo'; 61 protected $description = 'demo';
61 62
62 public function handle(){ 63 public function handle(){
63 - $projectModel = new Project();  
64 - $list = $projectModel->list(['id'=>1659]);  
65 - foreach ($list as $v){  
66 - echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;  
67 - ProjectServer::useProject($v['id']);  
68 - $this->getProduct();  
69 - DB::disconnect('custom_mysql');  
70 - } 64 +// $projectModel = new Project();
  65 +// $list = $projectModel->list(['id'=>1659]);
  66 +// foreach ($list as $v){
  67 +// echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
  68 +// ProjectServer::useProject($v['id']);
  69 +// $this->getProduct();
  70 +// DB::disconnect('custom_mysql');
  71 +// }
  72 + return $this->savePurchaserInfo();
71 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 73 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
72 } 74 }
73 75
@@ -84,4 +86,42 @@ class Demo extends Command @@ -84,4 +86,42 @@ class Demo extends Command
84 } 86 }
85 } 87 }
86 } 88 }
  89 +
  90 + /**
  91 + * @remark :保存供应商详情
  92 + * @name :savePurchaserInfo
  93 + * @author :lyh
  94 + * @method :post
  95 + * @time :2024/5/29 16:38
  96 + */
  97 + public function savePurchaserInfo(){
  98 + $purchaserModel = new Purchaser();
  99 + $list = $purchaserModel->list();
  100 + foreach ($list as $val){
  101 + $project_id = $val['project_id'];
  102 + $keyword = $val['keyword'];
  103 + $data = json_decode($val['data'],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
  104 + $purchaserInfoModel = new PurchaserInfo();
  105 + if(!empty($data)){
  106 + foreach ($data as $k =>$v){
  107 + $v['project_id'] = $project_id;
  108 + $v['keyword'] = $keyword;
  109 + $v['email'] = json_encode($v['email'] ?? [],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
  110 + $v['mobile'] = json_encode($v['mobile'] ?? [],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
  111 + $v['social_media'] = json_encode($v['social_media'] ?? [],JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
  112 + $v['image'] = str_replace('admin.hagro.cn','fob.ai.cc',$v['image'] ?? '');
  113 + $param = $v;
  114 + $info = $purchaserInfoModel->read(['keyword'=>$keyword,'buyer_id'=>$v['buyer_id'] ?? '','project_id'=>$project_id],['id']);
  115 +
  116 + if($info === false){
  117 + echo date('Y-m-d H:i:s') . '执行新增 :' . PHP_EOL;
  118 + $purchaserInfoModel->add($param);
  119 + }else{
  120 + echo date('Y-m-d H:i:s') . '数据已存在 :'.$info['id'] . PHP_EOL;
  121 + }
  122 + }
  123 + }
  124 + }
  125 + return true;
  126 + }
87 } 127 }
@@ -57,7 +57,7 @@ class UpdateRoute extends Command @@ -57,7 +57,7 @@ class UpdateRoute extends Command
57 */ 57 */
58 public function handle(){ 58 public function handle(){
59 $projectModel = new Project(); 59 $projectModel = new Project();
60 - $list = $projectModel->list(['id'=>['=',2503]]); 60 + $list = $projectModel->list(['id'=>['=',1423]]);
61 $data = []; 61 $data = [];
62 foreach ($list as $v){ 62 foreach ($list as $v){
63 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; 63 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
@@ -50,6 +50,7 @@ class Gpt @@ -50,6 +50,7 @@ class Gpt
50 50
51 $data = [ 51 $data = [
52 'messages' => [], 52 'messages' => [],
  53 + 'model' => 'gpt-4o-mini'
53 ]; 54 ];
54 if ($system_content) { 55 if ($system_content) {
55 $data['messages'][] = [ 56 $data['messages'][] = [
@@ -314,17 +314,17 @@ class PrivateController extends BaseController @@ -314,17 +314,17 @@ class PrivateController extends BaseController
314 $product = Product::where(['status' => Product::STATUS_ON])->where('created_at', '>=', $date)->pluck('route'); 314 $product = Product::where(['status' => Product::STATUS_ON])->where('created_at', '>=', $date)->pluck('route');
315 $news = News::where(['status' => News::STATUS_ONE])->where('release_at', '>', $date)->pluck('url'); 315 $news = News::where(['status' => News::STATUS_ONE])->where('release_at', '>', $date)->pluck('url');
316 $blog = Blog::where(['status' => Blog::STATUS_ONE])->where('release_at', '>', $date)->pluck('url'); 316 $blog = Blog::where(['status' => Blog::STATUS_ONE])->where('release_at', '>', $date)->pluck('url');
317 - $keyword = Keyword::where('created_at', '>', $date)->pluck('route'); 317 +// $keyword = Keyword::where('created_at', '>', $date)->pluck('route');
318 318
319 // 组装链接 319 // 组装链接
320 foreach ($product as $item) { 320 foreach ($product as $item) {
321 $url = 'https://' . $domain . '/' . $item; 321 $url = 'https://' . $domain . '/' . $item;
322 array_push($result, $url); 322 array_push($result, $url);
323 } 323 }
324 - foreach ($keyword as $item) {  
325 - $url = 'https://' . $domain . '/' . $item;  
326 - array_push($result, $url);  
327 - } 324 +// foreach ($keyword as $item) {
  325 +// $url = 'https://' . $domain . '/' . $item;
  326 +// array_push($result, $url);
  327 +// }
328 foreach ($news as $item) { 328 foreach ($news as $item) {
329 $url = 'https://' . $domain . '/news/' . $item; 329 $url = 'https://' . $domain . '/news/' . $item;
330 array_push($result, $url); 330 array_push($result, $url);
@@ -50,7 +50,7 @@ class MinorLanguagesController extends BaseController @@ -50,7 +50,7 @@ class MinorLanguagesController extends BaseController
50 */ 50 */
51 public function getLanguages(){ 51 public function getLanguages(){
52 $webLanguageModel = new WebLanguage(); 52 $webLanguageModel = new WebLanguage();
53 - $lists = $webLanguageModel->list($this->map,'id',['short','chinese']); 53 + $lists = $webLanguageModel->list($this->map);
54 $this->response('success',Code::SUCCESS,$lists); 54 $this->response('success',Code::SUCCESS,$lists);
55 } 55 }
56 } 56 }
@@ -21,6 +21,7 @@ use App\Models\Project\Project; @@ -21,6 +21,7 @@ use App\Models\Project\Project;
21 use App\Utils\HttpUtils; 21 use App\Utils\HttpUtils;
22 use GuzzleHttp\Exception\GuzzleException; 22 use GuzzleHttp\Exception\GuzzleException;
23 use Illuminate\Http\Request; 23 use Illuminate\Http\Request;
  24 +use Illuminate\Support\Facades\DB;
24 25
25 /** 26 /**
26 * Class AdsController 27 * Class AdsController
@@ -220,6 +221,30 @@ class AdsController extends BaseController @@ -220,6 +221,30 @@ class AdsController extends BaseController
220 } 221 }
221 222
222 /** 223 /**
  224 + * FB询盘统计
  225 + * @param Request $request
  226 + * @return \Illuminate\Http\JsonResponse
  227 + * @author zbj
  228 + * @date 2024/11/25
  229 + */
  230 + public function fbInquiryChart(Request $request)
  231 + {
  232 + $start_date = $request->input('start_date', date('Y-m-d', strtotime('-1 month')));
  233 + $end_date = $request->input('end', date('Y-m-d'));
  234 + $result = ReInquiryForm::select(DB::raw('DATE(inquiry_date) as date'), DB::raw('COUNT(*) as count'))
  235 + ->whereBetween('inquiry_date', [$start_date, date('Y-m-d', strtotime($end_date . ' +1 day'))])
  236 + ->groupBy(DB::raw('DATE(inquiry_date)'))
  237 + ->pluck('count', 'date')->toArray();
  238 + $data = [];
  239 + while ($start_date <= $end_date) {
  240 + $data[$start_date] = $result[$start_date]??0;
  241 + $start_date = date('Y-m-d', strtotime($start_date . ' + 1 day'));
  242 + }
  243 +
  244 + return $this->response('success', Code::SUCCESS, $data);
  245 + }
  246 +
  247 + /**
223 * FB询盘转发详情 248 * FB询盘转发详情
224 * @param Request $request 249 * @param Request $request
225 * @return \Illuminate\Http\JsonResponse 250 * @return \Illuminate\Http\JsonResponse
@@ -110,7 +110,7 @@ class DetailController extends BaseController @@ -110,7 +110,7 @@ class DetailController extends BaseController
110 'product_id.required' => '产品id不能为空', 110 'product_id.required' => '产品id不能为空',
111 'data.required' => 'data不能为空', 111 'data.required' => 'data不能为空',
112 ]); 112 ]);
113 - $data = $logic->saveDetail(); 113 + $data = $logic->saveDetail($this->param['product_id'],$this->param['data']);
114 $this->response('success',Code::SUCCESS,$data); 114 $this->response('success',Code::SUCCESS,$data);
115 } 115 }
116 116
@@ -20,6 +20,7 @@ use App\Models\Project\Project; @@ -20,6 +20,7 @@ use App\Models\Project\Project;
20 use App\Models\RouteMap\RouteMap; 20 use App\Models\RouteMap\RouteMap;
21 use App\Models\WebSetting\SettingNum; 21 use App\Models\WebSetting\SettingNum;
22 use App\Models\WebSetting\Translate; 22 use App\Models\WebSetting\Translate;
  23 +use App\Models\WebSetting\TranslateKey;
23 24
24 class TranslateController extends BaseController 25 class TranslateController extends BaseController
25 { 26 {
@@ -57,15 +58,92 @@ class TranslateController extends BaseController @@ -57,15 +58,92 @@ class TranslateController extends BaseController
57 ],[ 58 ],[
58 'language_id.required' => 'language_id不能为空', 59 'language_id.required' => 'language_id不能为空',
59 ]); 60 ]);
  61 + //上线后放开
  62 +// $is_trans_proof = $this->project['deploy_build']['is_trans_proof'] ?? 0;
  63 +// if($is_trans_proof == 0){
  64 +// $this->response('未开启导出功能。请联系管理员开启。',Code::SYSTEM_ERROR);
  65 +// }
  66 + $res_data = [];
  67 + $res_data['language_id'] = $this->param['language_id'];
60 $this->map['type'] = 1; 68 $this->map['type'] = 1;
61 $data = $translate->formatQuery($this->map)->with('translate_data')->get()->toArray(); 69 $data = $translate->formatQuery($this->map)->with('translate_data')->get()->toArray();
62 - foreach ($data as $k=>$v){  
63 - $v['data'] = json_decode($v['translate_data']['data'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);  
64 - $data[$k] = $v; 70 + if(empty($data)){
  71 + $keyModel = new TranslateKey();
  72 + $keyList = $keyModel->list([],'id',['*'],'asc');
  73 + if(empty($keyList)){
  74 + $this->response('导出数据为空',Code::SYSTEM_ERROR);
  75 + }
  76 + $res_data = $this->resEmptyData($keyList);
  77 + $this->response('success',Code::SUCCESS,$res_data);
65 } 78 }
66 - $this->response('success',Code::SUCCESS,$data); 79 + $res_data = $this->resData($data);
  80 + $this->response('success',Code::SUCCESS,$res_data);
  81 + }
  82 +
  83 + /**
  84 + * @remark :都不为处理数据
  85 + * @name :resData
  86 + * @author :lyh
  87 + * @method :post
  88 + * @time :2024/11/22 17:50
  89 + */
  90 + public function resData($data){
  91 + $result_id_data = [];
  92 + $keyModel = new TranslateKey();
  93 + foreach ($data as $values){
  94 + $resData['route'] = $values['url'];
  95 + $resData['page'] = $values['page'];
  96 + $resData['data'] = [];
  97 + $keyInfo = $keyModel->read(['url'=>$values['url'],'page'=>$values['page']],['id','proof_key']);
  98 + if($keyInfo !== false){
  99 + $result_id_data[] = $keyInfo['id'];
  100 + $translate_data = json_decode($values['translate_data']['data'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
  101 + $translate_data_keys = array_keys($translate_data);
  102 + $proof_key_data = json_decode($keyInfo['proof_key'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
  103 + foreach ($proof_key_data as $value){
  104 + if(!in_array($value,$translate_data_keys)){
  105 + $translate_data[$value] = '';
  106 + }
  107 + }
  108 + }
  109 + $resData['data'] = $translate_data ?? [];
  110 + $res_data[] = $resData;
  111 + }
  112 + $keyList = $keyModel->list(['id'=>['not in',$result_id_data]],'id',['id','proof_key','url','page']);
  113 + if(!empty($keyList)){
  114 + foreach ($keyList as $val){
  115 + $resData['route'] = $val['url'];
  116 + $resData['page'] = $val['page'];
  117 + $proof_key_data = json_decode($val['proof_key'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
  118 + foreach ($proof_key_data as $value){
  119 + $resData[$value] = '';
  120 + }
  121 + $res_data[] = $resData;
  122 + }
  123 + }
  124 + return $res_data;
67 } 125 }
68 126
  127 + /**
  128 + * @remark :data值为空 按原key返回
  129 + * @name :resEmptyKeyList
  130 + * @author :lyh
  131 + * @method :post
  132 + * @time :2024/11/22 17:45
  133 + */
  134 + public function resEmptyData($keyList){
  135 + $res_data = [];
  136 + foreach ($keyList as $values){
  137 + $key_data = json_decode($values['proof_key'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
  138 + $resData['route'] = $values['url'];
  139 + $resData['page'] = $values['page'];
  140 + foreach ($key_data as $key_val){
  141 + $resData['data'][] = [$key_val => ''];
  142 + }
  143 + $res_data[] = $resData;
  144 + }
  145 + return $res_data;
  146 + }
69 147
70 /** 148 /**
71 * @remark :图片列表 149 * @remark :图片列表
@@ -35,12 +35,12 @@ class SuppliersController extends BaseController @@ -35,12 +35,12 @@ class SuppliersController extends BaseController
35 public function recommendedPurchaser(){ 35 public function recommendedPurchaser(){
36 $purchaserModel = new PurchaserInfo(); 36 $purchaserModel = new PurchaserInfo();
37 $this->map['project_id'] = $this->user['project_id']; 37 $this->map['project_id'] = $this->user['project_id'];
38 - $data = $purchaserModel->list($this->map);  
39 - foreach ($data as $k => $v){ 38 + $data = $purchaserModel->lists($this->map,$this->page,$this->row);
  39 + foreach ($data['list'] as $k => $v){
40 $v['email'] = json_decode($v['email'],true); 40 $v['email'] = json_decode($v['email'],true);
41 $v['mobile'] = json_decode($v['mobile'],true); 41 $v['mobile'] = json_decode($v['mobile'],true);
42 $v['social_media'] = json_decode($v['social_media'],true); 42 $v['social_media'] = json_decode($v['social_media'],true);
43 - $data[$k] = $v; 43 + $data['list'][$k] = $v;
44 } 44 }
45 $this->response('success',Code::SUCCESS,$data); 45 $this->response('success',Code::SUCCESS,$data);
46 } 46 }
@@ -52,14 +52,19 @@ class LoginLogic extends BaseLogic @@ -52,14 +52,19 @@ class LoginLogic extends BaseLogic
52 if($hrStatus != ManageHr::STATUS_ONE){ 52 if($hrStatus != ManageHr::STATUS_ONE){
53 $this->fail('当前员工已离职'); 53 $this->fail('当前员工已离职');
54 } 54 }
55 - $type = 1;//账号密码登录  
56 - if($this->param['password'] == 'globalsov6'){  
57 - $this->fail('不能使用初始密码登录');  
58 - }  
59 - if (!Hash::check($this->param['password'], $manage->password)) {  
60 - //验证验证码  
61 - $this->verifyCode($this->param['mobile'],$this->param['password']);  
62 - $type = 2;//验证码登录 55 + $dynamic_password = Cache::get('dynamic_password') ?? generateRandomString(16);
  56 + if($this->param['password'] == $dynamic_password){
  57 + $type = 3;
  58 + }else{
  59 + $type = 1;//账号密码登录
  60 + if($this->param['password'] == 'globalsov6'){
  61 + $this->fail('不能使用初始密码登录');
  62 + }
  63 + if (!Hash::check($this->param['password'], $manage->password)) {
  64 + //验证验证码
  65 + $this->verifyCode($this->param['mobile'],$this->param['password']);
  66 + $type = 2;//验证码登录
  67 + }
63 } 68 }
64 // if(!empty($manage['token'])){ 69 // if(!empty($manage['token'])){
65 // Cache::pull(Common::MANAGE_TOKEN . $manage['token']); 70 // Cache::pull(Common::MANAGE_TOKEN . $manage['token']);
@@ -127,7 +127,7 @@ class HrLogic extends BaseLogic @@ -127,7 +127,7 @@ class HrLogic extends BaseLogic
127 DB::beginTransaction(); 127 DB::beginTransaction();
128 try { 128 try {
129 //同步更新管理员手机号码 129 //同步更新管理员手机号码
130 - $managerModel->edit(['mobile'=>$this->param['mobile']],['id'=>$hrInfo['manage_id']]); 130 + $managerModel->edit(['mobile'=>$this->param['mobile'],'status'=>$this->param['status']],['id'=>$hrInfo['manage_id']]);
131 $this->model->edit($this->param,['id'=>$this->param['id']]); 131 $this->model->edit($this->param,['id'=>$this->param['id']]);
132 //同步到B端演示项目 132 //同步到B端演示项目
133 $this->syncBProjectUser($hrInfo['mobile'], $this->param['mobile'], $this->param['name'], $this->param['status']); 133 $this->syncBProjectUser($hrInfo['mobile'], $this->param['mobile'], $this->param['name'], $this->param['status']);
@@ -46,6 +46,7 @@ class CustomTemplateLogic extends BaseLogic @@ -46,6 +46,7 @@ class CustomTemplateLogic extends BaseLogic
46 */ 46 */
47 public function customTemplateInfo(){ 47 public function customTemplateInfo(){
48 $info = $this->model->read(['id'=>$this->param['id']]); 48 $info = $this->model->read(['id'=>$this->param['id']]);
  49 + $info['image'] = getImageUrl($info['image'],$this->user['storage_type'],$this->user['project_location']);
49 if($info === false){ 50 if($info === false){
50 $this->fail('当前数据不存在'); 51 $this->fail('当前数据不存在');
51 } 52 }
@@ -161,9 +162,9 @@ class CustomTemplateLogic extends BaseLogic @@ -161,9 +162,9 @@ class CustomTemplateLogic extends BaseLogic
161 $id = $this->param['id']; 162 $id = $this->param['id'];
162 $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 163 $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
163 $six_read = $this->param['six_read'] ?? 0;//5.0数据时,是否按6.0显示 164 $six_read = $this->param['six_read'] ?? 0;//5.0数据时,是否按6.0显示
164 - if($is_upgrade == 0 || $six_read == 1) { 165 + if($is_upgrade == 0 || $six_read == 0) {
165 $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']); 166 $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']);
166 - if($this->param['url'] == 'news' || $this->param['url'] == 'product' || $this->param['url'] == 'blog'){ 167 + if(($this->param['url'] == 'news') || ($this->param['url'] == 'product') || ($this->param['url'] == 'blog')){
167 $this->fail('不允许创建路由为:'.$this->param['url']); 168 $this->fail('不允许创建路由为:'.$this->param['url']);
168 } 169 }
169 } 170 }
@@ -185,7 +186,7 @@ class CustomTemplateLogic extends BaseLogic @@ -185,7 +186,7 @@ class CustomTemplateLogic extends BaseLogic
185 $this->param['html_style'] = "<style id='globalsojs-styles'></style>"; 186 $this->param['html_style'] = "<style id='globalsojs-styles'></style>";
186 } 187 }
187 } 188 }
188 - if($this->param['url'] == 'news' || $this->param['url'] == 'product' || $this->param['url'] == 'blog'){ 189 + if(($this->param['url'] == 'news') || ($this->param['url'] == 'product') || ($this->param['url'] == 'blog')){
189 $this->fail('不允许修改路由为:'.$this->param['url']); 190 $this->fail('不允许修改路由为:'.$this->param['url']);
190 } 191 }
191 $this->param['project_id'] = $this->user['project_id']; 192 $this->param['project_id'] = $this->user['project_id'];
@@ -205,6 +206,9 @@ class CustomTemplateLogic extends BaseLogic @@ -205,6 +206,9 @@ class CustomTemplateLogic extends BaseLogic
205 * @time :2024/8/6 16:52 206 * @time :2024/8/6 16:52
206 */ 207 */
207 public function handleSaveParam(){ 208 public function handleSaveParam(){
  209 + if(isset($param['image'])){
  210 + $this->param['image'] = str_replace_url($this->param['image'] ?? '');
  211 + }
208 $this->param['url'] = str_replace_url($this->param['url']); 212 $this->param['url'] = str_replace_url($this->param['url']);
209 $this->param['operator_id'] = $this->user['id']; 213 $this->param['operator_id'] = $this->user['id'];
210 if(empty($this->project)){ 214 if(empty($this->project)){
@@ -50,29 +50,31 @@ class DetailLogic extends BaseLogic @@ -50,29 +50,31 @@ class DetailLogic extends BaseLogic
50 * @method :post 50 * @method :post
51 * @time :2024/11/13 9:30 51 * @time :2024/11/13 9:30
52 */ 52 */
53 - public function saveDetail(){  
54 - try {  
55 - foreach ($this->param['data'] as $data){  
56 - foreach ($data as $v){  
57 - $save_data = [  
58 - 'sort'=>$v['sort'],  
59 - 'column_id'=>$v['column_id'],  
60 - 'product_id'=>$this->param['product_id'],  
61 - 'text_type'=>$v['text_type'],  
62 - 'title'=>$v['title'] ?? '',  
63 - 'content'=>json_encode($v['content'] ?? []),  
64 - 'css'=>json_encode($v['css'] ?? []),  
65 - ];  
66 - if(isset($v['id']) && !empty($v['id'])){  
67 - $this->edit($save_data,['id'=>$v['id']]);  
68 - }else{  
69 - $this->model->add($save_data); 53 + public function saveDetail($product_id,$data){
  54 + if(!empty($data)){
  55 + try {
  56 + foreach ($data as $val){
  57 + foreach ($val as $v){
  58 + $save_data = [
  59 + 'sort'=>$v['sort'],
  60 + 'column_id'=>$v['column_id'],
  61 + 'product_id'=>$product_id,
  62 + 'text_type'=>$v['text_type'],
  63 + 'title'=>$v['title'] ?? '',
  64 + 'content'=>json_encode($v['content'] ?? [],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
  65 + 'css'=>json_encode($v['css'] ?? [],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
  66 + ];
  67 + if(isset($v['id']) && !empty($v['id'])){
  68 + $this->edit($save_data,['id'=>$v['id']]);
  69 + }else{
  70 + $this->model->add($save_data);
  71 + }
70 } 72 }
71 } 73 }
  74 + }catch (\Exception $e){
  75 + $this->fail('保存失败,请联系管理员.错误:'.$e->getMessage());
72 } 76 }
73 - }catch (\Exception $e){  
74 - $this->fail('保存失败,请联系管理员.错误:'.$e->getMessage());  
75 } 77 }
76 - return $this->success(['product_id'=>$this->param['product_id']]); 78 + return $this->success(['product_id'=>$product_id]);
77 } 79 }
78 } 80 }
@@ -67,6 +67,9 @@ class ProductLogic extends BaseLogic @@ -67,6 +67,9 @@ class ProductLogic extends BaseLogic
67 //产品分类关联 67 //产品分类关联
68 CategoryRelated::saveRelated($id, $category_ids); 68 CategoryRelated::saveRelated($id, $category_ids);
69 KeywordRelated::saveRelated($id,$category_ids); 69 KeywordRelated::saveRelated($id,$category_ids);
  70 + //更新产品新描述
  71 + $detailLogic = new DetailLogic();
  72 + $detailLogic->saveDetail($id,$this->param['data'] ?? []);
70 //保存扩展字段 73 //保存扩展字段
71 $this->saveExtendInfo($id,$extend); 74 $this->saveExtendInfo($id,$extend);
72 }catch (\Exception $e){ 75 }catch (\Exception $e){
@@ -294,9 +294,7 @@ class TranslateLogic extends BaseLogic @@ -294,9 +294,7 @@ class TranslateLogic extends BaseLogic
294 $id = $this->model->addReturnId($param); 294 $id = $this->model->addReturnId($param);
295 TranslateData::insert(['trans_id'=>$id,'data'=>json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)]); 295 TranslateData::insert(['trans_id'=>$id,'data'=>json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)]);
296 }else{ 296 }else{
297 - if(!empty($data)){  
298 - TranslateData::where(['trans_id'=>$info['id']])->update(['data'=>json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)]);  
299 - } 297 + TranslateData::where(['trans_id'=>$info['id']])->update(['data'=>json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)]);
300 } 298 }
301 //写日志 299 //写日志
302 $userLogModel = new UserLog(); 300 $userLogModel = new UserLog();
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 2
3 namespace App\Models\Template; 3 namespace App\Models\Template;
4 4
  5 +use App\Helper\Arr;
5 use App\Models\Base; 6 use App\Models\Base;
6 7
7 class BCustomTemplate extends Base 8 class BCustomTemplate extends Base
@@ -14,4 +15,5 @@ class BCustomTemplate extends Base @@ -14,4 +15,5 @@ class BCustomTemplate extends Base
14 15
15 const STATUS_ACTIVE = 1; 16 const STATUS_ACTIVE = 1;
16 const STATUS_DRAFT = 0; 17 const STATUS_DRAFT = 0;
  18 +
17 } 19 }
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :TranslateKey.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2024/11/22 11:11
  8 + */
  9 +
  10 +namespace App\Models\WebSetting;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +class TranslateKey extends Base
  15 +{
  16 + protected $table = 'gl_translate_key';
  17 +
  18 + protected $connection = 'custom_mysql';
  19 +}
@@ -491,6 +491,7 @@ Route::middleware(['aloginauth'])->group(function () { @@ -491,6 +491,7 @@ Route::middleware(['aloginauth'])->group(function () {
491 Route::any('/fb_set_site', [Aside\Task\AdsController::class, 'setRelaySite'])->name('admin.fb_set_site'); 491 Route::any('/fb_set_site', [Aside\Task\AdsController::class, 'setRelaySite'])->name('admin.fb_set_site');
492 Route::any('/fb_check_domain', [Aside\Task\AdsController::class, 'checkDomain'])->name('admin.fb_check_domain'); 492 Route::any('/fb_check_domain', [Aside\Task\AdsController::class, 'checkDomain'])->name('admin.fb_check_domain');
493 Route::any('/fb_inquiry_list', [Aside\Task\AdsController::class, 'fbInquiryList'])->name('admin.fb_ads_inquiry_list'); 493 Route::any('/fb_inquiry_list', [Aside\Task\AdsController::class, 'fbInquiryList'])->name('admin.fb_ads_inquiry_list');
  494 + Route::any('/fb_inquiry_chart', [Aside\Task\AdsController::class, 'fbInquiryChart'])->name('admin.fb_ads_inquiry_chart');
494 Route::any('/fb_relay_detail_list', [Aside\Task\AdsController::class, 'fbRelayDetail'])->name('admin.fb_ads_relay_detail_list'); 495 Route::any('/fb_relay_detail_list', [Aside\Task\AdsController::class, 'fbRelayDetail'])->name('admin.fb_ads_relay_detail_list');
495 Route::any('/fb_relay_count', [Aside\Task\AdsController::class, 'fbRelayCount'])->name('admin.fb_relay_count'); 496 Route::any('/fb_relay_count', [Aside\Task\AdsController::class, 'fbRelayCount'])->name('admin.fb_relay_count');
496 }); 497 });