|
@@ -96,4 +96,35 @@ class Model_logic_tools extends Lin_Model {
|
|
|
function readCache($filename){
|
|
function readCache($filename){
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ function transfer_img_url($url,$host){
|
|
|
|
|
+ if(strpos($url,'/img/thumb?src=') !== false){
|
|
|
|
|
+ preg_match('/src=([^&]+)&w=/', $url, $matches);
|
|
|
|
|
+ $result = $matches[1] ?? '';
|
|
|
|
|
+ if(empty($result)){
|
|
|
|
|
+ return $url;
|
|
|
|
|
+ }
|
|
|
|
|
+ $result = $host.$result;
|
|
|
|
|
+ return $result;
|
|
|
|
|
+ }elseif(strpos($url,'https://1.wepolicy.cn')!== false){
|
|
|
|
|
+ $str = str_replace('https://1.wepolicy.cn',$host,$url);
|
|
|
|
|
+ return $str;
|
|
|
|
|
+ }elseif(strpos($url,'http://1.wepolicy.cn')!== false){
|
|
|
|
|
+ $str = str_replace('http://1.wepolicy.cn',$host,$url);
|
|
|
|
|
+ return $str;
|
|
|
|
|
+ }elseif(strpos($url,'http://erp.hnwmzp.cn')!== false){
|
|
|
|
|
+ $str = str_replace('http://erp.hnwmzp.cn',$host,$url);
|
|
|
|
|
+ return $url;
|
|
|
|
|
+ }elseif(strpos($url,'http://a.wepolicy.cn')!== false){
|
|
|
|
|
+ $str = str_replace('http://a.wepolicy.cn',$host,$url);
|
|
|
|
|
+ return $url;
|
|
|
|
|
+ }elseif(strpos($url,'https://erp.hnwmzp.cn')!== false){
|
|
|
|
|
+ $str = str_replace('http://a.wepolicy.cn',$host,$url);
|
|
|
|
|
+ return $url;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ return $url;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|