作者 lyh

gx数据~

@@ -209,14 +209,15 @@ class KeywordVideoController extends BaseController @@ -209,14 +209,15 @@ class KeywordVideoController extends BaseController
209 */ 209 */
210 public function get_template(){ 210 public function get_template(){
211 $data = Cache::get('template_data'); 211 $data = Cache::get('template_data');
  212 + $data = null;
212 if(empty($data)){ 213 if(empty($data)){
213 $url = 'http://216.250.255.116:7866/get_template'; 214 $url = 'http://216.250.255.116:7866/get_template';
214 $header = [ 215 $header = [
215 'accept: application/json' 216 'accept: application/json'
216 ]; 217 ];
217 $data = http_get($url,$header); 218 $data = http_get($url,$header);
218 - if(!empty($data)){  
219 - Cache::put('template_data',$data,12 * 3600); 219 + if(!empty($data['data'])){
  220 + Cache::put('template_data',$data['data'],12 * 3600);
220 } 221 }
221 } 222 }
222 $this->response('success',Code::SUCCESS,$data); 223 $this->response('success',Code::SUCCESS,$data);
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 namespace App\Http\Logic\Bside\News; 3 namespace App\Http\Logic\Bside\News;
4 4
5 use App\Enums\Common\Code; 5 use App\Enums\Common\Code;
  6 +use App\Helper\Arr;
6 use App\Http\Logic\Bside\BaseLogic; 7 use App\Http\Logic\Bside\BaseLogic;
7 use App\Models\News\News; 8 use App\Models\News\News;
8 use App\Models\News\NewsCategory; 9 use App\Models\News\NewsCategory;
@@ -185,9 +186,7 @@ class NewsLogic extends BaseLogic @@ -185,9 +186,7 @@ class NewsLogic extends BaseLogic
185 if(isset($param['image'])){ 186 if(isset($param['image'])){
186 $param['image'] = str_replace_url($param['image'] ?? ''); 187 $param['image'] = str_replace_url($param['image'] ?? '');
187 } 188 }
188 - if(isset($param['related_news_id'])){  
189 - $param['related_news_id'] = implode(',',$param['related_news_id']);  
190 - } 189 +
191 if(isset($this->param['id'])){ 190 if(isset($this->param['id'])){
192 $param['operator_id'] = $this->user['id']; 191 $param['operator_id'] = $this->user['id'];
193 }else{ 192 }else{
@@ -204,6 +203,9 @@ class NewsLogic extends BaseLogic @@ -204,6 +203,9 @@ class NewsLogic extends BaseLogic
204 $this->fail('发布时间需大于当天'); 203 $this->fail('发布时间需大于当天');
205 } 204 }
206 } 205 }
  206 + if(isset($param['related_news_id'])){
  207 + $param['related_news_id'] = implode(',',$param['related_news_id']);
  208 + }
207 return $this->success($param); 209 return $this->success($param);
208 } 210 }
209 211