接口修改1

This commit is contained in:
彭桃 2023-02-13 09:42:36 +08:00
parent 0119afc874
commit fe84d06c58
2 changed files with 50 additions and 183 deletions

View File

@ -1417,6 +1417,9 @@ class Maintainentry extends BaseController
} }
} }
if(!isset($post['breed_area'])){
$post['breed_area'] = 0;
}
$waste_land_area = $post['land_area'] - $mianji - $post['breed_area']; $waste_land_area = $post['land_area'] - $mianji - $post['breed_area'];
if($waste_land_area < 0){ if($waste_land_area < 0){
$waste_land_area = 0; $waste_land_area = 0;

View File

@ -684,15 +684,29 @@ class Statistics extends BaseController
$where[] = ['b.village_id', '=', $village_id]; $where[] = ['b.village_id', '=', $village_id];
} }
$list = Db::connect('shop')->table('eb_merchant') // $list = Db::connect('shop')->table('eb_merchant')
->alias('a') // ->alias('a')
->join('eb_merchant_address b','a.mer_id = b.mer_id') // ->join('eb_merchant_address b','a.mer_id = b.mer_id')
->field('mer_name,real_name,mer_phone,mer_address,mer_keyword,mer_avatar,sales,category_id') // ->field('mer_name,real_name,mer_phone,mer_address,mer_keyword,mer_avatar,sales,category_id')
->withAttr('category',function ($value,$data){ // ->withAttr('category',function ($value,$data){
return Db::connect('shop')->table('eb_merchant_category')->where('merchant_category_id',$data['category_id'])->value('category_name'); // return Db::connect('shop')->table('eb_merchant_category')->where('merchant_category_id',$data['category_id'])->value('category_name');
}) // })
->where($where) // ->where($where)
->select(); // ->select();
// 先给假数据
$list = [
['mer_name'=>'得德店铺','category'=>'番茄,白菜','sales'=>'211','real_name'=>'赵德'],
['mer_name'=>'梦瑜店铺','category'=>'土豆,山药','sales'=>'365','real_name'=>'钱凯'],
['mer_name'=>'庆磊店铺','category'=>'玉米,萝卜','sales'=>'687','real_name'=>'孙佳镇'],
['mer_name'=>'先敬店铺','category'=>'鸡,鸭','sales'=>'456','real_name'=>'李需任'],
['mer_name'=>'葵魁店铺','category'=>'鱼,虾','sales'=>'527','real_name'=>'周开江'],
['mer_name'=>'泰盛店铺','category'=>'红薯,地瓜','sales'=>'369','real_name'=>'武艺'],
['mer_name'=>'瑞科店铺','category'=>'猪,羊','sales'=>'875','real_name'=>'郑成'],
['mer_name'=>'通骏店铺','category'=>'牛,鹅','sales'=>'489','real_name'=>'王爱国'],
['mer_name'=>'荫应店铺','category'=>'大米,小麦','sales'=>'702','real_name'=>'冯安康'],
['mer_name'=>'享翔店铺','category'=>'萝卜,白菜','sales'=>'635','real_name'=>'陈辰'],
];
$this->apiSuccess('获取成功',$list); $this->apiSuccess('获取成功',$list);
} }
@ -756,181 +770,31 @@ class Statistics extends BaseController
'name'=>'萝卜', 'name'=>'萝卜',
'demand'=>7852, 'demand'=>7852,
'minnum'=> 'minnum'=>
[['month'=>'1月','value'=>'661'], [['value'=>'661'],
['month'=>'2月','value'=>'356'], ['value'=>'356'],
['month'=>'3月','value'=>'415'], ['value'=>'415'],
['month'=>'4月','value'=>'258'], ['value'=>'258'],
['month'=>'5月','value'=>'779'], ['value'=>'779'],
['month'=>'6月','value'=>'1465'], ['value'=>'1465'],
['month'=>'7月','value'=>'668'], ['value'=>'668'],
['month'=>'8月','value'=>'571'], ['value'=>'571'],
['month'=>'9月','value'=>'498'], ['value'=>'498'],
['month'=>'10月','value'=>'587'], ['value'=>'587'],
['month'=>'11月','value'=>'881'], ['value'=>'881'],
['month'=>'12月','value'=>'1008']], ['value'=>'1008']],
'maxnum'=> 'maxnum'=>
[['month'=>'1月','value'=>'879'], [['value'=>'879'],
['month'=>'2月','value'=>'521'], ['value'=>'521'],
['month'=>'3月','value'=>'754'], ['value'=>'754'],
['month'=>'4月','value'=>'369'], ['value'=>'369'],
['month'=>'5月','value'=>'916'], ['value'=>'916'],
['month'=>'6月','value'=>'1874'], ['value'=>'1874'],
['month'=>'7月','value'=>'837'], ['value'=>'837'],
['month'=>'8月','value'=>'667'], ['value'=>'667'],
['month'=>'9月','value'=>'547'], ['value'=>'547'],
['month'=>'10月','value'=>'741'], ['value'=>'741'],
['month'=>'11月','value'=>'983'], ['value'=>'983'],
['month'=>'12月','value'=>'1150']], ['value'=>'1150']],
],
[
'name'=>'白菜',
'demand'=>8869,
'minnum'=>
[['month'=>'1月','value'=>'123'],
['month'=>'2月','value'=>'456'],
['month'=>'3月','value'=>'789'],
['month'=>'4月','value'=>'147'],
['month'=>'5月','value'=>'258'],
['month'=>'6月','value'=>'369'],
['month'=>'7月','value'=>'159'],
['month'=>'8月','value'=>'267'],
['month'=>'9月','value'=>'367'],
['month'=>'10月','value'=>'541'],
['month'=>'11月','value'=>'354'],
['month'=>'12月','value'=>'897']],
'maxnum'=>
[['month'=>'1月','value'=>'879'],
['month'=>'2月','value'=>'897'],
['month'=>'3月','value'=>'1053'],
['month'=>'4月','value'=>'354'],
['month'=>'5月','value'=>'535'],
['month'=>'6月','value'=>'774'],
['month'=>'7月','value'=>'337'],
['month'=>'8月','value'=>'410'],
['month'=>'9月','value'=>'468'],
['month'=>'10月','value'=>'600'],
['month'=>'11月','value'=>'883'],
['month'=>'12月','value'=>'1100']],
],
[
'name'=>'芋头',
'demand'=>2356,
'minnum'=>
[['month'=>'1月','value'=>'245'],
['month'=>'2月','value'=>'245'],
['month'=>'3月','value'=>'411'],
['month'=>'4月','value'=>'246'],
['month'=>'5月','value'=>'631'],
['month'=>'6月','value'=>'1234'],
['month'=>'7月','value'=>'546'],
['month'=>'8月','value'=>'246'],
['month'=>'9月','value'=>'356'],
['month'=>'10月','value'=>'466'],
['month'=>'11月','value'=>'744'],
['month'=>'12月','value'=>'998']],
'maxnum'=>
[['month'=>'1月','value'=>'879'],
['month'=>'2月','value'=>'511'],
['month'=>'3月','value'=>'754'],
['month'=>'4月','value'=>'469'],
['month'=>'5月','value'=>'916'],
['month'=>'6月','value'=>'1474'],
['month'=>'7月','value'=>'887'],
['month'=>'8月','value'=>'710'],
['month'=>'9月','value'=>'678'],
['month'=>'10月','value'=>'854'],
['month'=>'11月','value'=>'983'],
['month'=>'12月','value'=>'1005']],
],
[
'name'=>'地瓜',
'demand'=>3641,
'minnum'=>
[['month'=>'1月','value'=>'255'],
['month'=>'2月','value'=>'324'],
['month'=>'3月','value'=>'124'],
['month'=>'4月','value'=>'235'],
['month'=>'5月','value'=>'364'],
['month'=>'6月','value'=>'688'],
['month'=>'7月','value'=>'678'],
['month'=>'8月','value'=>'471'],
['month'=>'9月','value'=>'468'],
['month'=>'10月','value'=>'510'],
['month'=>'11月','value'=>'789'],
['month'=>'12月','value'=>'986']],
'maxnum'=>
[['month'=>'1月','value'=>'899'],
['month'=>'2月','value'=>'531'],
['month'=>'3月','value'=>'759'],
['month'=>'4月','value'=>'569'],
['month'=>'5月','value'=>'946'],
['month'=>'6月','value'=>'1474'],
['month'=>'7月','value'=>'737'],
['month'=>'8月','value'=>'610'],
['month'=>'9月','value'=>'538'],
['month'=>'10月','value'=>'700'],
['month'=>'11月','value'=>'911'],
['month'=>'12月','value'=>'1050']],
],
[
'name'=>'土豆',
'demand'=>5345,
'minnum'=>
[['month'=>'1月','value'=>'468'],
['month'=>'2月','value'=>'315'],
['month'=>'3月','value'=>'409'],
['month'=>'4月','value'=>'268'],
['month'=>'5月','value'=>'756'],
['month'=>'6月','value'=>'1126'],
['month'=>'7月','value'=>'641'],
['month'=>'8月','value'=>'552'],
['month'=>'9月','value'=>'483'],
['month'=>'10月','value'=>'568'],
['month'=>'11月','value'=>'821'],
['month'=>'12月','value'=>'896']],
'maxnum'=>
[['month'=>'1月','value'=>'879'],
['month'=>'2月','value'=>'551'],
['month'=>'3月','value'=>'756'],
['month'=>'4月','value'=>'389'],
['month'=>'5月','value'=>'946'],
['month'=>'6月','value'=>'1474'],
['month'=>'7月','value'=>'847'],
['month'=>'8月','value'=>'720'],
['month'=>'9月','value'=>'668'],
['month'=>'10月','value'=>'830'],
['month'=>'11月','value'=>'993'],
['month'=>'12月','value'=>'1260']],
],
[
'name'=>'山药',
'demand'=>6548,
'minnum'=>
[['month'=>'1月','value'=>'578'],
['month'=>'2月','value'=>'316'],
['month'=>'3月','value'=>'409'],
['month'=>'4月','value'=>'249'],
['month'=>'5月','value'=>'789'],
['month'=>'6月','value'=>'1420'],
['month'=>'7月','value'=>'647'],
['month'=>'8月','value'=>'561'],
['month'=>'9月','value'=>'478'],
['month'=>'10月','value'=>'513'],
['month'=>'11月','value'=>'841'],
['month'=>'12月','value'=>'889']],
'maxnum'=>
[['month'=>'1月','value'=>'889'],
['month'=>'2月','value'=>'531'],
['month'=>'3月','value'=>'774'],
['month'=>'4月','value'=>'569'],
['month'=>'5月','value'=>'910'],
['month'=>'6月','value'=>'1574'],
['month'=>'7月','value'=>'857'],
['month'=>'8月','value'=>'740'],
['month'=>'9月','value'=>'648'],
['month'=>'10月','value'=>'810'],
['month'=>'11月','value'=>'983'],
['month'=>'12月','value'=>'1241']],
], ],
]; ];
$this->apiSuccess('获取成功',$return); $this->apiSuccess('获取成功',$return);