作者 刘锟

update

@@ -11,7 +11,6 @@ namespace App\Console\Commands\Domain; @@ -11,7 +11,6 @@ namespace App\Console\Commands\Domain;
11 11
12 use Illuminate\Console\Command; 12 use Illuminate\Console\Command;
13 use App\Models\Domain\DomainInfo as DomainInfoModel; 13 use App\Models\Domain\DomainInfo as DomainInfoModel;
14 -use Illuminate\Support\Facades\Log;  
15 14
16 class DomainInfo extends Command 15 class DomainInfo extends Command
17 { 16 {
@@ -47,7 +46,7 @@ class DomainInfo extends Command @@ -47,7 +46,7 @@ class DomainInfo extends Command
47 //AMP站证书到期更新 46 //AMP站证书到期更新
48 $this->startUpdateAmpCert(); 47 $this->startUpdateAmpCert();
49 48
50 - return 1; 49 + return true;
51 } 50 }
52 51
53 /** 52 /**
@@ -16,6 +16,8 @@ use App\Models\Manage\BelongingGroup; @@ -16,6 +16,8 @@ use App\Models\Manage\BelongingGroup;
16 use App\Models\Manage\Dept; 16 use App\Models\Manage\Dept;
17 use App\Models\Manage\EntryPosition; 17 use App\Models\Manage\EntryPosition;
18 use App\Models\Manage\ManageHr; 18 use App\Models\Manage\ManageHr;
  19 +use App\Models\Project\Project;
  20 +use App\Models\WebSetting\WebSettingService;
19 use App\Services\ProjectServer; 21 use App\Services\ProjectServer;
20 use App\Services\SyncService; 22 use App\Services\SyncService;
21 use GuzzleHttp\Client; 23 use GuzzleHttp\Client;
@@ -76,187 +78,200 @@ class Demo extends Command @@ -76,187 +78,200 @@ class Demo extends Command
76 /** 78 /**
77 * @return bool 79 * @return bool
78 */ 80 */
79 - public function handle()  
80 - {  
81 - return $this->domain();  
82 - $result = app(SyncService::class)->projectAcceptAddress(1);  
83 - dd($result);  
84 - $data = [  
85 - 'key' => 'productkey_keyword',  
86 - 'keywords' => 'apple watch'  
87 - ];  
88 - $result = Common::send_openai_msg('v2/openai_chat', $data);  
89 - dd();  
90 - $string = 'demo.globalso.site/';  
91 - $domain_array = parse_url($string);  
92 - $domain = $domain_array['host'] ?? $domain_array['path'];  
93 - dd($domain);  
94 - $data = [];  
95 - dd(isset($data['a']['b']));  
96 - $url = 'https://demo.globalso.site/';  
97 - $action = 'api/updateHtmlNotify/';  
98 - $data = [  
99 - 'project_id' => 1,  
100 - 'type' => 1,  
101 - 'route' => 1  
102 - ];;  
103 - $method = 'GET';  
104 - $result = $this->curlRequest($url . $action, $data, $method);  
105 - dd($result);  
106 -  
107 - $context = stream_context_create([  
108 - 'ssl' => [  
109 - 'capture_peer_cert' => true,  
110 - 'capture_peer_cert_chain' => false,  
111 - ],  
112 - ]);  
113 -  
114 - $stream = stream_socket_client('ssl://oa.quanqiusou.cn:443', $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context);  
115 -  
116 - if(!$stream) {  
117 - die("Failed to connect: $errno - $errstr");  
118 - }  
119 -  
120 - $remote_cert = stream_context_get_params($stream)['options']['ssl']['peer_certificate'];  
121 -  
122 - if(!$remote_cert) {  
123 - die("Failed to retrieve certificate");  
124 - }  
125 -  
126 - $valid_from = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validFrom_time_t']);  
127 - $valid_to = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validTo_time_t']);  
128 -  
129 - fclose($stream);  
130 -  
131 - echo "Certificate Valid From: $valid_from<br>";  
132 - echo "Certificate Valid To: $valid_to<br>";  
133 -  
134 - dd('end');  
135 - $dept_array = [  
136 - '品牌部',  
137 - '综合部',  
138 - '渠道部',  
139 - '广告推广部',  
140 - 'AICC运营部',  
141 - '黑格运营部',  
142 - '直营运营部',  
143 - '直营销售部',  
144 - '深圳跨境部',  
145 - '外贸部',  
146 - '研发部',  
147 - '技术部',  
148 - '售后部',  
149 - ];  
150 - foreach ($dept_array as $v) {  
151 - $dept = Dept::where(['title' => $v])->first();  
152 - if (FALSE == empty($dept))  
153 - continue;  
154 - $dept = new Dept();  
155 - $dept->title = $v;  
156 - $dept->save();  
157 - }  
158 -// dd('dept end');  
159 - $dept_map = Dept::pluck('title', 'id')->toArray();  
160 - $belonging_map = BelongingGroup::pluck('name', 'id')->toArray();  
161 -// dd($belonging_map);  
162 -  
163 - $filename = storage_path('logs/oa_hr.txt');  
164 - $string = file_get_contents($filename);  
165 - $data = explode("\r\n", $string);  
166 - $data = array_filter($data);  
167 - $dept = '';  
168 - foreach ($data as $k=>$v) {  
169 -// var_dump($v) . PHP_EOL;  
170 - if ($k == 1)  
171 - continue;  
172 - $tmp = explode("\t", $v);  
173 - if (count($tmp) == 3) {  
174 - $dept = $tmp[0] ? : $dept;  
175 - $position = $tmp[1];  
176 - $name = $tmp[2];  
177 - } else if (count($tmp) == 2) {  
178 - $position = $tmp[0];  
179 - $name = $tmp[1];  
180 - } else {  
181 - Log::info($v . PHP_EOL);  
182 - continue;  
183 - }  
184 -  
185 -  
186 -// Log::info($dept . '---' . $position . '---' . $name . PHP_EOL);  
187 -// continue;  
188 -  
189 - $dept_id = array_search($dept, $dept_map);  
190 - $belonging_id = 17;  
191 - if (FALSE !== strpos($dept,'技术部')) {  
192 - $belonging_string = str_replace('技术部', '', $dept);  
193 - if ($belonging_string) {  
194 - $belonging_string = $belonging_string . '组';  
195 - $belonging_id = array_search($belonging_string, $belonging_map);  
196 - }  
197 -  
198 - $dept_tmp = '技术部';  
199 - $dept_id = array_search($dept_tmp, $dept_map);  
200 - }  
201 - if (FALSE !== strpos($dept,'售后')) {  
202 - $belonging_string = str_replace('售后', '', $dept);  
203 - if ($belonging_string)  
204 - $belonging_id = array_search($belonging_string, $belonging_map);  
205 - $dept_tmp = '售后部';  
206 - $dept_id = array_search($dept_tmp, $dept_map);  
207 - }  
208 -  
209 - $position_log = EntryPosition::where(['name' => $position])->first();  
210 - if (empty($position_log)) {  
211 - $position_log = new EntryPosition();  
212 - $position_log->name = $position;  
213 - $position_log->save();  
214 - }  
215 - $position_id = $position_log->id;  
216 -  
217 - $hr = ManageHr::where(['name' => $name])->first();  
218 - if (empty($hr)) {  
219 - Log::info($k . '-' . $name . '-' . $dept . '-' . $dept_id . '-' . $position . '-' . $position_id);  
220 - continue;  
221 - }  
222 -  
223 - $hr->belong_group = $belonging_id;  
224 - $hr->dept_id = $dept_id;  
225 - $hr->entry_position = $position_id;  
226 - $hr->save();  
227 - echo $k . '-' . $name . '-' . $dept . '-' . $dept_id . '-' . $position . '-' . $position_id . '-' . '组' . '-' . $belonging_id . PHP_EOL;  
228 -  
229 - }  
230 - dd('end');  
231 - exit; 81 +// public function handle()
  82 +// {
  83 +// return $this->domain();
  84 +// $result = app(SyncService::class)->projectAcceptAddress(1);
  85 +// dd($result);
  86 +// $data = [
  87 +// 'key' => 'productkey_keyword',
  88 +// 'keywords' => 'apple watch'
  89 +// ];
  90 +// $result = Common::send_openai_msg('v2/openai_chat', $data);
  91 +// dd();
  92 +// $string = 'demo.globalso.site/';
  93 +// $domain_array = parse_url($string);
  94 +// $domain = $domain_array['host'] ?? $domain_array['path'];
  95 +// dd($domain);
  96 +// $data = [];
  97 +// dd(isset($data['a']['b']));
  98 +// $url = 'https://demo.globalso.site/';
  99 +// $action = 'api/updateHtmlNotify/';
  100 +// $data = [
  101 +// 'project_id' => 1,
  102 +// 'type' => 1,
  103 +// 'route' => 1
  104 +// ];;
  105 +// $method = 'GET';
  106 +// $result = $this->curlRequest($url . $action, $data, $method);
  107 +// dd($result);
  108 +//
  109 +// $context = stream_context_create([
  110 +// 'ssl' => [
  111 +// 'capture_peer_cert' => true,
  112 +// 'capture_peer_cert_chain' => false,
  113 +// ],
  114 +// ]);
  115 +//
  116 +// $stream = stream_socket_client('ssl://oa.quanqiusou.cn:443', $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context);
  117 +//
  118 +// if(!$stream) {
  119 +// die("Failed to connect: $errno - $errstr");
  120 +// }
  121 +//
  122 +// $remote_cert = stream_context_get_params($stream)['options']['ssl']['peer_certificate'];
  123 +//
  124 +// if(!$remote_cert) {
  125 +// die("Failed to retrieve certificate");
  126 +// }
  127 +//
  128 +// $valid_from = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validFrom_time_t']);
  129 +// $valid_to = date('Y-m-d H:i:s', openssl_x509_parse($remote_cert)['validTo_time_t']);
  130 +//
  131 +// fclose($stream);
  132 +//
  133 +// echo "Certificate Valid From: $valid_from<br>";
  134 +// echo "Certificate Valid To: $valid_to<br>";
  135 +//
  136 +// dd('end');
  137 +// $dept_array = [
  138 +// '品牌部',
  139 +// '综合部',
  140 +// '渠道部',
  141 +// '广告推广部',
  142 +// 'AICC运营部',
  143 +// '黑格运营部',
  144 +// '直营运营部',
  145 +// '直营销售部',
  146 +// '深圳跨境部',
  147 +// '外贸部',
  148 +// '研发部',
  149 +// '技术部',
  150 +// '售后部',
  151 +// ];
  152 +// foreach ($dept_array as $v) {
  153 +// $dept = Dept::where(['title' => $v])->first();
  154 +// if (FALSE == empty($dept))
  155 +// continue;
  156 +// $dept = new Dept();
  157 +// $dept->title = $v;
  158 +// $dept->save();
  159 +// }
  160 +//// dd('dept end');
  161 +// $dept_map = Dept::pluck('title', 'id')->toArray();
  162 +// $belonging_map = BelongingGroup::pluck('name', 'id')->toArray();
  163 +//// dd($belonging_map);
  164 +//
  165 +// $filename = storage_path('logs/oa_hr.txt');
  166 +// $string = file_get_contents($filename);
  167 +// $data = explode("\r\n", $string);
  168 +// $data = array_filter($data);
  169 +// $dept = '';
  170 +// foreach ($data as $k=>$v) {
  171 +//// var_dump($v) . PHP_EOL;
  172 +// if ($k == 1)
  173 +// continue;
  174 +// $tmp = explode("\t", $v);
  175 +// if (count($tmp) == 3) {
  176 +// $dept = $tmp[0] ? : $dept;
  177 +// $position = $tmp[1];
  178 +// $name = $tmp[2];
  179 +// } else if (count($tmp) == 2) {
  180 +// $position = $tmp[0];
  181 +// $name = $tmp[1];
  182 +// } else {
  183 +// Log::info($v . PHP_EOL);
  184 +// continue;
  185 +// }
  186 +//
  187 +//
  188 +//// Log::info($dept . '---' . $position . '---' . $name . PHP_EOL);
  189 +//// continue;
  190 +//
  191 +// $dept_id = array_search($dept, $dept_map);
  192 +// $belonging_id = 17;
  193 +// if (FALSE !== strpos($dept,'技术部')) {
  194 +// $belonging_string = str_replace('技术部', '', $dept);
  195 +// if ($belonging_string) {
  196 +// $belonging_string = $belonging_string . '组';
  197 +// $belonging_id = array_search($belonging_string, $belonging_map);
  198 +// }
  199 +//
  200 +// $dept_tmp = '技术部';
  201 +// $dept_id = array_search($dept_tmp, $dept_map);
  202 +// }
  203 +// if (FALSE !== strpos($dept,'售后')) {
  204 +// $belonging_string = str_replace('售后', '', $dept);
  205 +// if ($belonging_string)
  206 +// $belonging_id = array_search($belonging_string, $belonging_map);
  207 +// $dept_tmp = '售后部';
  208 +// $dept_id = array_search($dept_tmp, $dept_map);
  209 +// }
  210 +//
  211 +// $position_log = EntryPosition::where(['name' => $position])->first();
  212 +// if (empty($position_log)) {
  213 +// $position_log = new EntryPosition();
  214 +// $position_log->name = $position;
  215 +// $position_log->save();
  216 +// }
  217 +// $position_id = $position_log->id;
  218 +//
  219 +// $hr = ManageHr::where(['name' => $name])->first();
  220 +// if (empty($hr)) {
  221 +// Log::info($k . '-' . $name . '-' . $dept . '-' . $dept_id . '-' . $position . '-' . $position_id);
  222 +// continue;
  223 +// }
  224 +//
  225 +// $hr->belong_group = $belonging_id;
  226 +// $hr->dept_id = $dept_id;
  227 +// $hr->entry_position = $position_id;
  228 +// $hr->save();
  229 +// echo $k . '-' . $name . '-' . $dept . '-' . $dept_id . '-' . $position . '-' . $position_id . '-' . '组' . '-' . $belonging_id . PHP_EOL;
  230 +//
  231 +// }
  232 +// dd('end');
  233 +// exit;
  234 +//
  235 +// if (($handle = fopen($filename, 'r')) !== false) {
  236 +// while (($data = fgetcsv($handle, 1000, ',')) !== false) {
  237 +// // 处理每行数据
  238 +// Log::info(var_export($data, true));
  239 +// }
  240 +// fclose($handle);
  241 +// }
  242 +// exit;
  243 +//
  244 +// $group = BelongingGroup::get();
  245 +// dd($group->toArray());
  246 +// $domain = parse_url('https//:dev.golbalso.site/');
  247 +// dd($domain);
  248 +// echo time() . PHP_EOL;
  249 +// $blogModel = new Image();
  250 +// $list = $blogModel->list();
  251 +// echo time() . PHP_EOL;
  252 +// dd(count($list));
  253 +//
  254 +// return;
  255 +// preg_match_all("/\@include\(\"([a-z0-9_]+)\"\)/i",'
  256 +//@include("asdf")@include("")@include("asdtrw2erf")
  257 +// ',$include);
  258 +//
  259 +// print_r($include);
  260 +// }
232 261
233 - if (($handle = fopen($filename, 'r')) !== false) {  
234 - while (($data = fgetcsv($handle, 1000, ',')) !== false) {  
235 - // 处理每行数据  
236 - Log::info(var_export($data, true)); 262 + public function handle(){
  263 + $projectModel = new Project();
  264 + $list = $projectModel->list(['delete_status'=>0]);
  265 + foreach ($list as $v){
  266 + ProjectServer::useProject($v['id']);
  267 + $webSettingServiceModel = new WebSettingService();
  268 + $info = $webSettingServiceModel->read(['values'=>['like','%+86%']]);
  269 + if($info !== false){
  270 + echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
237 } 271 }
238 - fclose($handle); 272 + DB::disconnect('custom_mysql');
239 } 273 }
240 - exit;  
241 -  
242 - $group = BelongingGroup::get();  
243 - dd($group->toArray());  
244 - $domain = parse_url('https//:dev.golbalso.site/');  
245 - dd($domain);  
246 - echo time() . PHP_EOL;  
247 - $blogModel = new Image();  
248 - $list = $blogModel->list();  
249 - echo time() . PHP_EOL;  
250 - dd(count($list));  
251 -  
252 - return;  
253 - preg_match_all("/\@include\(\"([a-z0-9_]+)\"\)/i",'  
254 -@include("asdf")@include("")@include("asdtrw2erf")  
255 - ',$include);  
256 -  
257 - print_r($include);  
258 } 274 }
259 -  
260 public function printMessage() 275 public function printMessage()
261 { 276 {
262 $client = new Client(); 277 $client = new Client();
@@ -149,9 +149,9 @@ class QuanqiusouApi @@ -149,9 +149,9 @@ class QuanqiusouApi
149 */ 149 */
150 public function getHistoryCount($api_no, $lang = '') 150 public function getHistoryCount($api_no, $lang = '')
151 { 151 {
152 - $key = "quanqiusou_api_history_count_{$api_no}_{$lang}_" . date('Y-m-d');  
153 - $res = Cache::get($key);  
154 - if (!$res) { 152 +// $key = "quanqiusou_api_history_count_{$api_no}_{$lang}_" . date('Y-m-d');
  153 +// $res = Cache::get($key);
  154 +// if (!$res) {
155 $api_url = $this->url . '/google-rank/history_count.php'; 155 $api_url = $this->url . '/google-rank/history_count.php';
156 $param = [ 156 $param = [
157 'apino' => $api_no, 157 'apino' => $api_no,
@@ -163,13 +163,13 @@ class QuanqiusouApi @@ -163,13 +163,13 @@ class QuanqiusouApi
163 $res = HttpUtils::get($api_url, $param); 163 $res = HttpUtils::get($api_url, $param);
164 if($res){ 164 if($res){
165 $res = Arr::s2a($res); 165 $res = Arr::s2a($res);
166 - Cache::put($key, $res, 2 * 3600); 166 +// Cache::put($key, $res, 2 * 3600);
167 } 167 }
168 } catch (\Exception | GuzzleException $e) { 168 } catch (\Exception | GuzzleException $e) {
169 errorLog('获取历史排名统计数据失败', [], $e); 169 errorLog('获取历史排名统计数据失败', [], $e);
170 return false; 170 return false;
171 } 171 }
172 - } 172 +// }
173 return $res; 173 return $res;
174 } 174 }
175 175
@@ -6,9 +6,16 @@ use App\Enums\Common\Code; @@ -6,9 +6,16 @@ use App\Enums\Common\Code;
6 use App\Enums\Common\Common; 6 use App\Enums\Common\Common;
7 use App\Http\Controllers\Aside\BaseController; 7 use App\Http\Controllers\Aside\BaseController;
8 use App\Http\Logic\Aside\Manage\MenuLogic; 8 use App\Http\Logic\Aside\Manage\MenuLogic;
  9 +use App\Models\Domain\DomainInfo;
9 use App\Models\Inquiry\InquiryData; 10 use App\Models\Inquiry\InquiryData;
10 use App\Models\Manage\Manage; 11 use App\Models\Manage\Manage;
  12 +use App\Models\Product\Keyword;
  13 +use App\Models\Product\Product;
  14 +use App\Models\Project\Project;
  15 +use App\Models\RouteMap\RouteMap;
  16 +use App\Services\ProjectServer;
11 use Illuminate\Support\Facades\Cache; 17 use Illuminate\Support\Facades\Cache;
  18 +use Illuminate\Support\Facades\DB;
12 use Illuminate\Support\Facades\Hash; 19 use Illuminate\Support\Facades\Hash;
13 20
14 /** 21 /**
@@ -96,4 +103,59 @@ class IndexController extends BaseController @@ -96,4 +103,59 @@ class IndexController extends BaseController
96 $this->response('success'); 103 $this->response('success');
97 } 104 }
98 105
  106 + /**
  107 + * @remark :根据关键字获取产品主图
  108 + * @name :getKeywordList
  109 + * @author :lyh
  110 + * @method :post
  111 + * @time :2024/2/23 16:28
  112 + */
  113 + public function getKeywordImage(){
  114 + $arr = explode('/',trim(str_replace('https://', '', $this->param['url']),'/'));
  115 + if(empty($arr) || !is_array($arr)){
  116 + $this->response('当前项目不存在..',Code::SYSTEM_ERROR);
  117 + }
  118 + $domainModel = new DomainInfo();
  119 + $domainInfo = $domainModel->read(['domain'=>$arr[0]]);
  120 + if($domainInfo === false){
  121 + $this->response('当前项目不存在.',Code::SYSTEM_ERROR);
  122 + }
  123 + ProjectServer::useProject($domainInfo['project_id']);
  124 + $routeMapModel = new RouteMap();
  125 + $routeInfo = $routeMapModel->read(['route'=>$arr[1]]);
  126 + if($domainInfo === false){
  127 + $this->response('当前路由不存在.',Code::SYSTEM_ERROR);
  128 + }
  129 + $keywordModel = new Keyword();
  130 + $keywordInfo = $keywordModel->read(['id'=>$routeInfo['source_id']]);
  131 + $count = Product::where('keyword_id','like' ,'%,'.$keywordInfo['id'].',%')->count();
  132 + $productModel = new Product();
  133 + if($count < 5){
  134 + $productList = $productModel->list([],'sort',['thumb','title']);
  135 + //获取7个产品主图
  136 + }else{
  137 + $productList = $productModel->list(['keyword_id'=>['like','%,'.$keywordInfo['id'].',%']],['thumb','title']);
  138 + }
  139 + $product_image = [];
  140 + foreach ($productList as $k => $v){
  141 + $image = [];
  142 + if(!empty($v['thumb']) && !empty($v['thumb']['url'])){
  143 + $image['image'] = getImageUrl($v['thumb']['url']);
  144 + $image['title'] = $v['title'];
  145 + $product_image[] = $image;
  146 + }
  147 + if(count($product_image) > 6){
  148 + break;
  149 + }
  150 + }
  151 + $data = [
  152 + 'title'=>$keywordInfo['title'],
  153 + 'keyword_title'=>$keywordInfo['keyword_title'],
  154 + 'keyword_content'=>$keywordInfo['keyword_content'],
  155 + 'product_list'=>$product_image
  156 + ];
  157 + DB::disconnect('custom_mysql');
  158 + $this->response('success',Code::SUCCESS,$data);
  159 + }
  160 +
99 } 161 }
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :KeywordController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2024/2/26 9:23
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Aside\Com;
  11 +
  12 +use App\Http\Controllers\Aside\BaseController;
  13 +
  14 +class KeywordController extends BaseController
  15 +{
  16 + /**
  17 + * @remark :创建关键字任务池子
  18 + * @name :saveKeyword
  19 + * @author :lyh
  20 + * @method :post
  21 + * @time :2024/2/26 9:24
  22 + */
  23 + public function savePromotionKeyword(){
  24 + $this->request->validate([
  25 + 'data' => 'required|array',
  26 + 'project_id'=>'required',
  27 + ], [
  28 + 'data.required' => '自定义询盘数据不为空',
  29 + 'data.array' => '必须为数组',
  30 + 'project_id.required' => '项目唯一标识不为空',
  31 + ]);
  32 + foreach ($this->param['data'] as $v){
  33 + $param['keyword'] = $v;
  34 + $param['project_id'] = $this->param['project_id'];
  35 +
  36 + }
  37 + }
  38 +}
@@ -52,6 +52,12 @@ class UserLogic extends BaseLogic @@ -52,6 +52,12 @@ class UserLogic extends BaseLogic
52 //验证一个项目是否只有一个超级管理员 52 //验证一个项目是否只有一个超级管理员
53 $this->verifyRole($this->param); 53 $this->verifyRole($this->param);
54 if (isset($this->param['id']) && !empty($this->param['id'])) { 54 if (isset($this->param['id']) && !empty($this->param['id'])) {
  55 + $info = $this->model->read(['id'=>$this->param['id']]);
  56 + if($info['role_id'] == 0){
  57 + //更新项目信息
  58 + $projectModel = new Project();
  59 + $projectModel->edit(['lead_name'=>$this->param['name'],'mobile'=>$this->param['mobile']],['id'=>$info['project_id']]);
  60 + }
55 $this->param = $this->editPassword($this->param); 61 $this->param = $this->editPassword($this->param);
56 $rs = $this->model->edit($this->param, ['id' => $this->param['id']]); 62 $rs = $this->model->edit($this->param, ['id' => $this->param['id']]);
57 } else { 63 } else {
@@ -57,7 +57,7 @@ class CopyProjectJob implements ShouldQueue @@ -57,7 +57,7 @@ class CopyProjectJob implements ShouldQueue
57 $data = $data->getAttributes(); 57 $data = $data->getAttributes();
58 $type = $data['type']; 58 $type = $data['type'];
59 $data['type'] = 0; 59 $data['type'] = 0;
60 - $data['old_project_id'] = $this->param['project_id']; 60 + $data['status'] = 0;
61 $data['title'] = $data['title'].'-copy'; 61 $data['title'] = $data['title'].'-copy';
62 unset($data['id']); 62 unset($data['id']);
63 $project_id = $projectModel->insertGetId($data); 63 $project_id = $projectModel->insertGetId($data);
@@ -160,7 +160,7 @@ class CopyProjectJob implements ShouldQueue @@ -160,7 +160,7 @@ class CopyProjectJob implements ShouldQueue
160 $sql = DB::connection('custom_tmp_mysql_copy')->select("SHOW CREATE TABLE {$table}"); 160 $sql = DB::connection('custom_tmp_mysql_copy')->select("SHOW CREATE TABLE {$table}");
161 DB::connection('custom_mysql')->statement(get_object_vars($sql[0])['Create Table']); 161 DB::connection('custom_mysql')->statement(get_object_vars($sql[0])['Create Table']);
162 } 162 }
163 - DB::connection('custom_mysql')->table($table)->truncate(); // 清空目标表数据 163 +// DB::connection('custom_mysql')->table($table)->truncate(); // 清空目标表数据
164 DB::connection('custom_mysql')->table($table)->insertUsing( 164 DB::connection('custom_mysql')->table($table)->insertUsing(
165 [], // 列名数组,留空表示插入所有列 165 [], // 列名数组,留空表示插入所有列
166 function ($query) use ($table,$project_id) { 166 function ($query) use ($table,$project_id) {
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :PromotionKeyword.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2024/2/26 9:33
  8 + */
  9 +
  10 +namespace App\Models\Com;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +class PromotionKeyword extends Base
  15 +{
  16 + protected $table = 'gl_promotion_keyword';
  17 +}
@@ -380,6 +380,7 @@ Route::group([], function () { @@ -380,6 +380,7 @@ Route::group([], function () {
380 Route::any('/collect', [Aside\Collect\CollectController::class, 'index'])->name('admin.collect'); 380 Route::any('/collect', [Aside\Collect\CollectController::class, 'index'])->name('admin.collect');
381 //同步询盘 381 //同步询盘
382 Route::any('/sync_inquiry', [Aside\Com\IndexController::class, 'sync_inquiry'])->name('admin.sync_inquiry'); 382 Route::any('/sync_inquiry', [Aside\Com\IndexController::class, 'sync_inquiry'])->name('admin.sync_inquiry');
  383 + Route::any('/getKeywordImage', [Aside\Com\IndexController::class, 'getKeywordImage'])->name('admin.getKeywordImage');
383 }); 384 });
384 385
385 386