FMSingerModel.m 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // FMSingerModel.m
  3. // FreeMusic
  4. //
  5. //
  6. #import "FMSingerModel.h"
  7. @implementation FMSingerModel
  8. //表名
  9. +(NSString *)getTableName
  10. {
  11. return @"FMSongerInfor";
  12. }
  13. //表版本
  14. +(int)getTableVersion
  15. {
  16. return 1;
  17. }
  18. +(NSString *)getPrimaryKey
  19. {
  20. return @"ting_uid";
  21. }
  22. -(NSMutableArray *)itemWith:(NSString *)name
  23. {
  24. NSMutableArray * array = [FMSingerModel searchWithWhere:[NSString stringWithFormat:@"name like '%%%@%%'",name] orderBy:nil offset:0 count:0];
  25. NSMutableArray * temp = [NSMutableArray new];
  26. NSMutableArray * temp1 = [NSMutableArray new];
  27. for (FMSingerModel * sub in array) {
  28. if ([sub.name length]!=0) {
  29. if ([sub.company length]!=0) {
  30. [temp addObject:sub];
  31. }else{
  32. [temp1 addObject:sub];
  33. }
  34. }
  35. }
  36. [temp addObjectsFromArray:temp1];
  37. return temp;
  38. }
  39. -(NSMutableArray *)itemTop100
  40. {
  41. // NSMutableArray * array = [FMSingerModel searchWithWhere:[NSString stringWithFormat:@"'songs_total' >1000"] orderBy:nil offset:0 count:50];
  42. return [self itemWith:@"李"];
  43. }
  44. @end