示例#1
0
 public function removeImageById($id)
 {
     if (Auth::check()) {
         $image = AdImage::whereId($id)->with('ad')->first();
         if (null !== $image && $image->ad->author_id == Auth::user()->id) {
             return AdImage::remove($id);
         }
     }
     return 0;
 }
示例#2
0
文件: AdImage.php 项目: elberd/maoh
 public static function remove($id)
 {
     $image = AdImage::whereId($id)->first();
     $image->delete();
     return 1;
 }