| @@ -380,7 +380,7 @@ def flyimg_upload_api(request): | ||
| 380 | 380 |  | 
| 381 | 381 |      photo = request.FILES.get('photo', '') | 
| 382 | 382 |  | 
| 383 | -    photo_id = int(request.POST.get('photo_id', -1)) | |
| 383 | +    next_id = int(request.POST.get('next_id', 0)) | |
| 384 | 384 |  | 
| 385 | 385 | try: | 
| 386 | 386 | user = UserInfo.objects.get(user_id=user_id) | 
| @@ -423,15 +423,17 @@ def flyimg_upload_api(request): | ||
| 423 | 423 |  | 
| 424 | 424 | group_photos = GroupPhotoInfo.objects.filter( | 
| 425 | 425 | group_id=group_id, | 
| 426 | - pk__gt=photo_id, | |
| 427 | - ).order_by( | |
| 428 | - 'created_at' | |
| 426 | + pk__gte=next_id, | |
| 429 | 427 | ) | 
| 428 | + latest_photo = group_photos.last() | |
| 430 | 429 |  | 
| 431 | 430 |      return JsonResponse({ | 
| 432 | 431 | 'status': 200, | 
| 433 | 432 | 'message': u'飞图上传成功', | 
| 434 | - 'data': [photo.photo_info for photo in group_photos], | |
| 433 | +        'data': { | |
| 434 | + 'next_id': latest_photo and latest_photo.pk or next_id, | |
| 435 | + 'photos': [photo.photo_info for photo in group_photos], | |
| 436 | + } | |
| 435 | 437 | }) | 
| 436 | 438 |  | 
| 437 | 439 |  |