作者 ZhengBing He

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

@@ -56,13 +56,40 @@ class lyhDemo extends Command @@ -56,13 +56,40 @@ class lyhDemo extends Command
56 protected $description = '更新路由'; 56 protected $description = '更新路由';
57 57
58 public function handle(){ 58 public function handle(){
59 - $string = '<p>Wow, the 137th Canton Fair was quite a game changer for EV Charging Pile suppliers! Seriously, it showcased some amazing growth in international participation and trade opportunities. Can you believe it? They reported a record-breaking 288,938 overseas buyers from 219 countries and regions, which is a 17.3% jump compared to the last fair. This kind of surge really highlights just how much the demand for electric vehicle infrastructure is ramping up. Industry forecasts suggest global EV sales could hit around 26 million units by 2030! And get this, export intentions at the fair climbed to a whopping $25.44 billion, marking a 3% increase. It’s clear that this fair has become a vital hub for manufacturers and suppliers in the EV Charging Pile sector, connecting them with international markets. Plus, the online platform keeps the networking going year-round, so companies can tap into new opportunities even after the fair wraps up. As everyone gears up for the 138th Canton Fair, it’s the perfect time for businesses to strategically carve out their space in the ever-growing EV charging scene.</p><img src="https://ecdn6.globalso.com/public/img/2025-05-24/9834757034_0.png" alt="Unlocking Global Opportunities at the 137th Canton Fair for Ev Charging Pile Suppliers" itemprop="image">';  
60 - $promote = AiCommand::where(['key' => 'ai_layout_design'])->first();  
61 - $promote = str_replace("{html}", $string, $promote->ai);  
62 - $aiCommandService = new AiCommandService();  
63 - $result = $aiCommandService->send_layout_design($promote);  
64 - dd($result);  
65 - return true; 59 + $projectModel = new Project();
  60 + $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[2,3,4,6]]], 'id', ['id']);
  61 + foreach ($lists as $item){
  62 + echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;
  63 + ProjectServer::useProject($item['id']);
  64 + $authorModel = new AiBlogAuthor();
  65 + $author_list = $authorModel->list(['id'=>['>',0]]);
  66 + if(empty($author_list)){
  67 + echo '跳过的项目id:'.$item['id'].PHP_EOL;
  68 + DB::disconnect('custom_mysql');
  69 + continue;
  70 + }
  71 + $projectAiSettingModel = new ProjectAiSetting();
  72 + $aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$item['id']]);
  73 + if($aiSettingInfo === false){
  74 + echo '跳过的项目id:'.$item['id'].PHP_EOL;
  75 + DB::disconnect('custom_mysql');
  76 + continue;
  77 + }
  78 + $aiBlogService = new AiBlogService($item['id']);
  79 + foreach ($author_list as $val){
  80 + $aiBlogService->author_id = $val['author_id'];
  81 + $result = $aiBlogService->getAuthorDetail();
  82 + if(isset($result['status']) && $result['status'] == 200){
  83 + //当前作者的页面
  84 + $aiBlogAuthorModel = new AiBlogAuthor();
  85 + $authorInfo = $aiBlogAuthorModel->read(['author_id'=>$val['author_id']],['id','route']);
  86 + if($authorInfo !== false && !empty($result['data']['section'])){
  87 + $aiBlogAuthorModel->edit(['text'=>$result['data']['section']],['author_id'=>$val['author_id']]);
  88 + }
  89 + }
  90 + }
  91 + DB::disconnect('custom_mysql');
  92 + }
66 } 93 }
67 94
68 public function _actionTemplateMain(){ 95 public function _actionTemplateMain(){
@@ -177,6 +177,13 @@ class IndexController extends BaseController @@ -177,6 +177,13 @@ class IndexController extends BaseController
177 'text.required' => '文本text不能为空', 177 'text.required' => '文本text不能为空',
178 'lang.required' => '语种不能为空', 178 'lang.required' => '语种不能为空',
179 ]); 179 ]);
  180 + if($this->param['lang'] == 0){
  181 + $lang = Translate::translateSl($this->param['text']);
  182 + $this->param['lang'] = $lang['texts']['sl'] ?? '';
  183 + }
  184 + if(empty($this->param['lang'])){
  185 + $this->fail('未获取到语种');
  186 + }
180 $service = new HumanizeAiTextService(); 187 $service = new HumanizeAiTextService();
181 $data = $service->humanizer($this->param['text'],$this->param['lang']); 188 $data = $service->humanizer($this->param['text'],$this->param['lang']);
182 $this->response('success', Code::SUCCESS, $data); 189 $this->response('success', Code::SUCCESS, $data);
@@ -139,11 +139,14 @@ class AiBlogLogic extends BaseLogic @@ -139,11 +139,14 @@ class AiBlogLogic extends BaseLogic
139 try { 139 try {
140 $aiSettingInfo = $this->getProjectAiSetting(); 140 $aiSettingInfo = $this->getProjectAiSetting();
141 $aiBlogService = new AiBlogService(); 141 $aiBlogService = new AiBlogService();
  142 + $aiBlogTask = new AiBlogTask();
142 foreach ($this->param['ids'] as $id) { 143 foreach ($this->param['ids'] as $id) {
143 - $info = $this->model->read(['id'=>$id],['task_id','route']); 144 + $info = $this->model->read(['id'=>$id],['task_id','route','author_id']);
144 $aiBlogService->mch_id = $aiSettingInfo['mch_id']; 145 $aiBlogService->mch_id = $aiSettingInfo['mch_id'];
145 $aiBlogService->key = $aiSettingInfo['key']; 146 $aiBlogService->key = $aiSettingInfo['key'];
146 $aiBlogService->delDetail($info['task_id']); 147 $aiBlogService->delDetail($info['task_id']);
  148 + //重新生成作者页面
  149 + $aiBlogTask->addReturnId(['type'=>$aiBlogTask::TYPE_AUTHOR_ID,'task_id'=>$info['author_id'],'status'=>1,'project_id'=>$this->user['project_id']]);
147 //删除路由映射 150 //删除路由映射
148 RouteMap::delRoute(RouteMap::SOURCE_AI_BLOG, $id, $this->user['project_id']); 151 RouteMap::delRoute(RouteMap::SOURCE_AI_BLOG, $id, $this->user['project_id']);
149 $this->model->del(['id'=>$id]); 152 $this->model->del(['id'=>$id]);
@@ -25,7 +25,7 @@ class MonthCountLogic extends BaseLogic @@ -25,7 +25,7 @@ class MonthCountLogic extends BaseLogic
25 */ 25 */
26 public function getCountLists($map,$order = 'created_at',$filed = ['*']){ 26 public function getCountLists($map,$order = 'created_at',$filed = ['*']){
27 $map['project_id'] = $this->user['project_id']; 27 $map['project_id'] = $this->user['project_id'];
28 - $lists = $this->model->list($map,$order,$filed,'desc',12); 28 + $lists = $this->model->list($map,$order,$filed,'desc');
29 if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){ 29 if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){
30 foreach ($lists as $k => $v){ 30 foreach ($lists as $k => $v){
31 if(empty($v['source_country'])){ 31 if(empty($v['source_country'])){
@@ -55,9 +55,9 @@ class MonthCountLogic extends BaseLogic @@ -55,9 +55,9 @@ class MonthCountLogic extends BaseLogic
55 */ 55 */
56 public function getIpPvCount(){ 56 public function getIpPvCount(){
57 $count = new Count(); 57 $count = new Count();
58 - $startTime = date("Y-m-d", strtotime("-11 months", mktime(0, 0, 0))); 58 + $startTime = date("Y-m-d", strtotime("-35 months", mktime(0, 0, 0)));
59 $ensTime = date('Y-m-d',time()); 59 $ensTime = date('Y-m-d',time());
60 - $lists = $count->list(['date'=>['between',[$startTime,$ensTime]],'project_id'=>$this->user['project_id']],'id',['*'],'asc'); 60 + $lists = $count->list(['date'=>['<=',$ensTime],'project_id'=>$this->user['project_id']],'id',['*'],'asc');
61 $groupedData = []; 61 $groupedData = [];
62 foreach ($lists as $v){ 62 foreach ($lists as $v){
63 $month = date('Y-m', strtotime($v['date'])); 63 $month = date('Y-m', strtotime($v['date']));