diff --git a/app/api/controller/AnimalBreedController.php b/app/api/controller/AnimalBreedController.php index 1c4fc01d..34124d44 100644 --- a/app/api/controller/AnimalBreedController.php +++ b/app/api/controller/AnimalBreedController.php @@ -107,6 +107,7 @@ } //获取数据 $data = Db::name('farmer_animal_breed')->whereRaw($query)->page($pageNo,$pageSize)->order('id desc')->select()->toArray(); + dump(Db::name('farmer_animal_breed')->getLastSql());die; //返回数据 return $this->success('请求成功',$data); } diff --git a/app/api/controller/UserController.php b/app/api/controller/UserController.php index fcaa89bf..07c08953 100644 --- a/app/api/controller/UserController.php +++ b/app/api/controller/UserController.php @@ -54,15 +54,15 @@ class UserController extends BaseApiController //判断是否是家畜养殖户 if($curl_result['data']['is_dw_user']){ //获取家畜养殖数量 - $animalCount = Db::name('farmer_animal_breed')->where('user_id',$params['user_id'])->count(); + $animalCount = Db::name('farmer_animal_breed')->where('user_id',$params['user_id'])->where('animal_status','<>',5)->count(); //获取家畜是公的数量 - $maleCount = Db::name('farmer_animal_breed')->where('user_id',$params['user_id'])->where('animal_gender',1)->count(); + $maleCount = Db::name('farmer_animal_breed')->where('user_id',$params['user_id'])->where('animal_gender',1)->where('animal_status','<>',5)->count(); //获取家畜是母的数量 - $maternalCount = Db::name('farmer_animal_breed')->where('user_id',$params['user_id'])->where('animal_gender',2)->count(); + $maternalCount = Db::name('farmer_animal_breed')->where('user_id',$params['user_id'])->where('animal_gender',2)->where('animal_status','<>',5)->count(); //获取家畜养殖种类 - $animalKind = Db::name('farmer_animal_breed')->distinct(true)->where('user_id',$params['user_id'])->limit(4)->column('animal_kind'); + $animalKind = Db::name('farmer_animal_breed')->distinct(true)->where('user_id',$params['user_id'])->where('animal_status','<>',5)->limit(4)->column('animal_kind'); //获取家畜养殖具体品种 - $animalBreed = Db::name('farmer_animal_breed')->distinct(true)->where('user_id',$params['user_id'])->limit(4)->column('animal_breed'); + $animalBreed = Db::name('farmer_animal_breed')->distinct(true)->where('user_id',$params['user_id'])->where('animal_status','<>',5)->limit(4)->column('animal_breed'); $curl_result['data']['animal_detail'] = [ 'total_count' => $animalCount, 'male_count' => $maleCount, @@ -74,15 +74,15 @@ class UserController extends BaseApiController //判断是否是家禽养殖户 if($curl_result['data']['is_jq_user']){ //获取家畜养殖数量 - $poultryCount = Db::name('farmer_poultry_breed')->where('user_id',$params['user_id'])->count(); + $poultryCount = Db::name('farmer_poultry_breed')->where('user_id',$params['user_id'])->where('status','<>',5)->count(); //获取家畜是公的数量 - $maleCount = Db::name('farmer_poultry_breed')->where('user_id',$params['user_id'])->where('gender',1)->count(); + $maleCount = Db::name('farmer_poultry_breed')->where('user_id',$params['user_id'])->where('gender',1)->where('status','<>',5)->count(); //获取家畜是母的数量 - $maternalCount = Db::name('farmer_poultry_breed')->where('user_id',$params['user_id'])->where('gender',2)->count(); + $maternalCount = Db::name('farmer_poultry_breed')->where('user_id',$params['user_id'])->where('gender',2)->where('status','<>',5)->count(); //获取家畜养殖种类 - $poultryKind = Db::name('farmer_poultry_breed')->distinct(true)->where('user_id',$params['user_id'])->limit(4)->column('kind'); + $poultryKind = Db::name('farmer_poultry_breed')->distinct(true)->where('user_id',$params['user_id'])->where('status','<>',5)->limit(4)->column('kind'); //获取家畜养殖具体品种 - $poultryBreed = Db::name('farmer_poultry_breed')->distinct(true)->where('user_id',$params['user_id'])->limit(4)->column('breed'); + $poultryBreed = Db::name('farmer_poultry_breed')->distinct(true)->where('user_id',$params['user_id'])->where('status','<>',5)->limit(4)->column('breed'); $curl_result['data']['poultry_detail'] = [ 'total_count' => $poultryCount, 'male_count' => $maleCount,