|
|
@@ -96,9 +96,9 @@ class Goodimglibrary extends Start_Controller {
|
|
|
foreach($imgs as $k => $v){
|
|
|
$type = $this->_checkVideo($v);
|
|
|
if($type == "video"){
|
|
|
- $str.= '<video controls="true" width="100" src="'.$this->show_url.rawurlencode($v).'" alt="video image" style="margin-right:3px;"></video>';
|
|
|
+ $str.= '<video controls="true" width="100" src="'.$this->$this->_transingurl($v).'" alt="video image" style="margin-right:3px;"></video>';
|
|
|
}else{
|
|
|
- $str .= '<img width="100px" src="'.$this->show_url.rawurlencode($v).'" alt="image" style="margin-right:3px;">';
|
|
|
+ $str .= '<img width="100px" src="'.$this->$this->_transingurl($v).'" alt="image" style="margin-right:3px;">';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -118,14 +118,14 @@ class Goodimglibrary extends Start_Controller {
|
|
|
$info = $this->db->get_where('crowd_goods',array('id'=>$id))->row_array();
|
|
|
$images = $this->goodimgs->find("goods_id = ".$id);
|
|
|
if(empty($images)){
|
|
|
- if($this->goodimgs->insert(array('goods_id'=>$id,'features'=>$info['features'],'source_cont'=>json_encode($img)))){
|
|
|
+ if($this->goodimgs->insert(array('goods_id'=>$id,'features'=>$info['features'],'source_cont'=>json_encode($img,JSON_UNESCAPED_SLASHES)))){
|
|
|
echo json_encode(array('msg'=>'修改成功','success'=>true));exit;
|
|
|
}else{
|
|
|
echo json_encode(array('msg'=>'修改失败,请重试1','success'=>false));exit;
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
- if($this->goodimgs->save(array('features'=>$info['features'],'source_cont'=>json_encode($img)),$images['id'])){
|
|
|
+ if($this->goodimgs->save(array('features'=>$info['features'],'source_cont'=>json_encode($img,JSON_UNESCAPED_SLASHES)),$images['id'])){
|
|
|
echo json_encode(array('msg'=>'修改成功','success'=>true));exit;
|
|
|
}else{
|
|
|
echo json_encode(array('msg'=>'修改失败,请重试2','success'=>false));exit;
|
|
|
@@ -144,7 +144,7 @@ class Goodimglibrary extends Start_Controller {
|
|
|
$imgs = json_decode($images[0]['source_cont'],true);
|
|
|
$final_imgs = [];
|
|
|
foreach($imgs as $k => $v){
|
|
|
- $final_imgs[$k]['url'] = $this->show_url.rawurlencode($v);
|
|
|
+ $final_imgs[$k]['url'] = $this->_transingurl($v);
|
|
|
$final_imgs[$k]['type'] = $this->_checkVideo($v);
|
|
|
}
|
|
|
$goods['images'] = $final_imgs;
|
|
|
@@ -166,5 +166,16 @@ class Goodimglibrary extends Start_Controller {
|
|
|
return "img";
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ private function _transingurl($url){
|
|
|
+ $url_arr = explode('/', $url);
|
|
|
+ $filename = array_pop($url_arr);
|
|
|
+ $filename = rawurlencode($filename);
|
|
|
+ $url_arr[] = $filename;
|
|
|
+ $final_url = implode('/', $url_arr);
|
|
|
+ $final_url = $this->show_url.$final_url;
|
|
|
+ return $final_url;
|
|
|
+ }
|
|
|
|
|
|
}
|