|
@@ -43,69 +43,6 @@ use Illuminate\Support\Facades\DB; |
|
@@ -43,69 +43,6 @@ use Illuminate\Support\Facades\DB; |
|
43
|
class CNoticeController extends BaseController
|
43
|
class CNoticeController extends BaseController
|
|
44
|
{
|
44
|
{
|
|
45
|
/**
|
45
|
/**
|
|
46
|
- * @remark :计算页面数量
|
|
|
|
47
|
- * @name :countLanguagePage
|
|
|
|
48
|
- * @author :lyh
|
|
|
|
49
|
- * @method :post
|
|
|
|
50
|
- * @time :2025/6/19 17:14
|
|
|
|
51
|
- */
|
|
|
|
52
|
- public function countLanguagePage(){
|
|
|
|
53
|
- $this->request->validate([
|
|
|
|
54
|
- 'language'=>'required',
|
|
|
|
55
|
- 'project_id'=>'required',
|
|
|
|
56
|
- ],[
|
|
|
|
57
|
- 'language.required' => 'language不能为空',
|
|
|
|
58
|
- 'project_id.required' => 'project_id不能为空',
|
|
|
|
59
|
- ]);
|
|
|
|
60
|
- $bigProjectModel = new TranslateBigProject();
|
|
|
|
61
|
- $project_id_arr = $bigProjectModel->selectField(['status'=>1],'project_id') ?? [];
|
|
|
|
62
|
- if(in_array($this->param['project_id'],$project_id_arr)){
|
|
|
|
63
|
- $this->response('success');
|
|
|
|
64
|
- }
|
|
|
|
65
|
- $lang_num = count($this->param['language']);
|
|
|
|
66
|
- ProjectServer::useProject($this->param['project_id']);
|
|
|
|
67
|
- $keyword_num = (new Keyword())->counts(['route'=>['!=',null]]);
|
|
|
|
68
|
- $data_num = $this->productNum() + $this->customNum() + $this->newsNum() + $this->blogNum();
|
|
|
|
69
|
- DB::disconnect('custom_mysql');
|
|
|
|
70
|
- $number = $keyword_num * 18 + $lang_num * $data_num;
|
|
|
|
71
|
- if($number >= 450000){
|
|
|
|
72
|
- $this->response('success',Code::SUCCESS,['msg'=>'翻译数量过多, 大概页面数量:'.$number.', 磁盘空间占用可能会超过40G,请联系管理员操作!']);
|
|
|
|
73
|
- }
|
|
|
|
74
|
- $this->response('success');
|
|
|
|
75
|
- }
|
|
|
|
76
|
-
|
|
|
|
77
|
- /**
|
|
|
|
78
|
- * @remark :产品分类页面数量
|
|
|
|
79
|
- * @name :productCateNum
|
|
|
|
80
|
- * @author :lyh
|
|
|
|
81
|
- * @method :post
|
|
|
|
82
|
- * @time :2025/1/4 10:43
|
|
|
|
83
|
- */
|
|
|
|
84
|
- public function productNum(){
|
|
|
|
85
|
- $number = (new Product())->counts(['status'=>1]);
|
|
|
|
86
|
- $settingModel = new SettingNum();
|
|
|
|
87
|
- $info = $settingModel->read(['type'=>1]);
|
|
|
|
88
|
- if($info === false){
|
|
|
|
89
|
- $product_page_number = 15;
|
|
|
|
90
|
- }else{
|
|
|
|
91
|
- $product_page_number = $info['num'];
|
|
|
|
92
|
- }
|
|
|
|
93
|
- $productCateModel = new Category();
|
|
|
|
94
|
- $productCateList = $productCateModel->list(['status'=>1]);
|
|
|
|
95
|
- if(!empty($productCateList)){
|
|
|
|
96
|
- $cateReModel = new CategoryRelated();
|
|
|
|
97
|
- foreach ($productCateList as $v){
|
|
|
|
98
|
- $cate_num = $cateReModel->counts(['cate_id'=>$v['id']]);
|
|
|
|
99
|
- if($cate_num == 0){
|
|
|
|
100
|
- $number += 1;
|
|
|
|
101
|
- }else{
|
|
|
|
102
|
- $number += ceil($cate_num / $product_page_number);
|
|
|
|
103
|
- }
|
|
|
|
104
|
- }
|
|
|
|
105
|
- }
|
|
|
|
106
|
- return $number;
|
|
|
|
107
|
- }
|
|
|
|
108
|
- /**
|
|
|
|
109
|
* 更新通知C端
|
46
|
* 更新通知C端
|
|
110
|
* @param Request $request
|
47
|
* @param Request $request
|
|
111
|
* @return \Illuminate\Http\JsonResponse
|
48
|
* @return \Illuminate\Http\JsonResponse
|
|
@@ -134,102 +71,8 @@ class CNoticeController extends BaseController |
|
@@ -134,102 +71,8 @@ class CNoticeController extends BaseController |
|
134
|
http_post($url, json_encode($param));
|
71
|
http_post($url, json_encode($param));
|
|
135
|
$this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!');
|
72
|
$this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!');
|
|
136
|
}
|
73
|
}
|
|
137
|
- /**
|
|
|
|
138
|
- * @remark :新闻数量
|
|
|
|
139
|
- * @name :newsNum
|
|
|
|
140
|
- * @author :lyh
|
|
|
|
141
|
- * @method :post
|
|
|
|
142
|
- * @time :2025/1/4 11:21
|
|
|
|
143
|
- */
|
|
|
|
144
|
- public function newsNum(){
|
|
|
|
145
|
- $newsModel = new News();
|
|
|
|
146
|
- $number = $newsModel->counts(['status'=>1]);
|
|
|
|
147
|
- $settingModel = new SettingNum();
|
|
|
|
148
|
- $info = $settingModel->read(['type'=>2]);
|
|
|
|
149
|
- if($info === false){
|
|
|
|
150
|
- $news_page_number = 10;
|
|
|
|
151
|
- }else{
|
|
|
|
152
|
- $news_page_number = $info['num'];
|
|
|
|
153
|
- }
|
|
|
|
154
|
- $newsCateModel = new NewsCategory();
|
|
|
|
155
|
- $newsCateList = $newsCateModel->list(['status'=>0]);
|
|
|
|
156
|
- if(!empty($newsCateList)){
|
|
|
|
157
|
- foreach ($newsCateList as $v){
|
|
|
|
158
|
- $cate_num = $newsModel->counts(['category_id'=>['like',','.$v['id'].',']]);
|
|
|
|
159
|
- if($cate_num == 0){
|
|
|
|
160
|
- $number += 1;
|
|
|
|
161
|
- }else{
|
|
|
|
162
|
- $number += ceil($cate_num / $news_page_number);
|
|
|
|
163
|
- }
|
|
|
|
164
|
- }
|
|
|
|
165
|
- }
|
|
|
|
166
|
- return $number;
|
|
|
|
167
|
- }
|
|
|
|
168
|
-
|
|
|
|
169
|
- /**
|
|
|
|
170
|
- * @remark :博客数量
|
|
|
|
171
|
- * @name :blogNum
|
|
|
|
172
|
- * @author :lyh
|
|
|
|
173
|
- * @method :post
|
|
|
|
174
|
- * @time :2025/1/4 11:21
|
|
|
|
175
|
- */
|
|
|
|
176
|
- public function blogNum(){
|
|
|
|
177
|
- $blogModel = new Blog();
|
|
|
|
178
|
- $number = $blogModel->counts(['status'=>1]);
|
|
|
|
179
|
- $settingModel = new SettingNum();
|
|
|
|
180
|
- $info = $settingModel->read(['type'=>3]);
|
|
|
|
181
|
- if($info === false){
|
|
|
|
182
|
- $news_page_number = 10;
|
|
|
|
183
|
- }else{
|
|
|
|
184
|
- $news_page_number = $info['num'];
|
|
|
|
185
|
- }
|
|
|
|
186
|
- $blogCateModel = new BlogCategory();
|
|
|
|
187
|
- $blogCateList = $blogCateModel->list(['status'=>0]);
|
|
|
|
188
|
- if(!empty($blogCateList)){
|
|
|
|
189
|
- foreach ($blogCateList as $v){
|
|
|
|
190
|
- $cate_num = $blogModel->counts(['category_id'=>['like',','.$v['id'].',']]);
|
|
|
|
191
|
- if($cate_num == 0){
|
|
|
|
192
|
- $number += 1;
|
|
|
|
193
|
- }else{
|
|
|
|
194
|
- $number += ceil($cate_num / $news_page_number);
|
|
|
|
195
|
- }
|
|
|
|
196
|
- }
|
|
|
|
197
|
- }
|
|
|
|
198
|
- return $number;
|
|
|
|
199
|
- }
|
|
|
|
200
|
|
74
|
|
|
201
|
/**
|
75
|
/**
|
|
202
|
- * @remark :扩展模块数量
|
|
|
|
203
|
- * @name :blogNum
|
|
|
|
204
|
- * @author :lyh
|
|
|
|
205
|
- * @method :post
|
|
|
|
206
|
- * @time :2025/1/4 11:21
|
|
|
|
207
|
- */
|
|
|
|
208
|
- public function customNum(){
|
|
|
|
209
|
- $contentModel = new CustomModuleContent();
|
|
|
|
210
|
- $number = $contentModel->counts(['status'=>0]);
|
|
|
|
211
|
- $settingModel = new SettingNum();
|
|
|
|
212
|
- $info = $settingModel->read(['type'=>2]);
|
|
|
|
213
|
- if($info === false){
|
|
|
|
214
|
- $news_page_number = 10;
|
|
|
|
215
|
- }else{
|
|
|
|
216
|
- $news_page_number = $info['num'];
|
|
|
|
217
|
- }
|
|
|
|
218
|
- $cateModel = new CustomModuleCategory();
|
|
|
|
219
|
- $cateList = $cateModel->list(['status'=>0]);
|
|
|
|
220
|
- if(!empty($cateList)){
|
|
|
|
221
|
- foreach ($cateList as $v){
|
|
|
|
222
|
- $cate_num = $contentModel->counts(['category_id'=>['like',','.$v['id'].',']]);
|
|
|
|
223
|
- if($cate_num == 0){
|
|
|
|
224
|
- $number += 1;
|
|
|
|
225
|
- }else{
|
|
|
|
226
|
- $number += ceil($cate_num / $news_page_number);
|
|
|
|
227
|
- }
|
|
|
|
228
|
- }
|
|
|
|
229
|
- }
|
|
|
|
230
|
- return $number;
|
|
|
|
231
|
- }
|
|
|
|
232
|
- /**
|
|
|
|
233
|
* @remark :获取当前项目选中的语种
|
76
|
* @remark :获取当前项目选中的语种
|
|
234
|
* @name :getCountry
|
77
|
* @name :getCountry
|
|
235
|
* @author :lyh
|
78
|
* @author :lyh
|