作者 郭静帆
1 个管道 的构建 通过 耗费 0 秒

公众号

... ... @@ -392,7 +392,6 @@ class Index extends Api
$info->is_collect = !empty($collect) ? 1 : 0;
$deposit = new Inform;
$info['inform'] = $deposit->where(['status'=>'1','job_id'=>$job_id,'deletetime'=>null])->order('id desc')->field('id,content,status,job_id')->find();
$info['inform']['content'] = str_replace('<img src="/uploads/', '<img src=" '. request()->domain() . '/uploads/', $info['inform']['content']);
$info->visible(['id','images','job_name','factory_price_total','factory_price','subsidy_price','salary','content','lng','lat','label_ids'])->append(['is_collect','inform']);
$this->success('成功',$info);
}
... ...
... ... @@ -9,4 +9,13 @@ use think\Model;
class Inform extends Model
{
protected $name='inform';
public function getContentAttr($value, $data)
{
$content = $data['content'];
$content = str_replace("<img src=\"/uploads", "<img style=\"width: 100%;!important\" src=\"" . request()->domain() . "/uploads", $content);
$content = str_replace("<video src=\"/uploads", "<video style=\"width: 100%;!important\" src=\"" . request()->domain() . "/uploads", $content);
return $content;
}
}
\ No newline at end of file
... ...