This commit is contained in:
weiz 2023-10-30 17:49:18 +08:00
parent 9a6e5b668e
commit 3af532c34b
2 changed files with 11 additions and 10 deletions

View File

@ -107,6 +107,7 @@
} }
//获取数据 //获取数据
$data = Db::name('farmer_animal_breed')->whereRaw($query)->page($pageNo,$pageSize)->order('id desc')->select()->toArray(); $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); return $this->success('请求成功',$data);
} }

View File

@ -54,15 +54,15 @@ class UserController extends BaseApiController
//判断是否是家畜养殖户 //判断是否是家畜养殖户
if($curl_result['data']['is_dw_user']){ 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'] = [ $curl_result['data']['animal_detail'] = [
'total_count' => $animalCount, 'total_count' => $animalCount,
'male_count' => $maleCount, 'male_count' => $maleCount,
@ -74,15 +74,15 @@ class UserController extends BaseApiController
//判断是否是家禽养殖户 //判断是否是家禽养殖户
if($curl_result['data']['is_jq_user']){ 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'] = [ $curl_result['data']['poultry_detail'] = [
'total_count' => $poultryCount, 'total_count' => $poultryCount,
'male_count' => $maleCount, 'male_count' => $maleCount,