update
This commit is contained in:
parent
cb2e1e805a
commit
50de5cf963
|
@ -81,7 +81,8 @@
|
||||||
$qrCodeFile = $qrCode->png($qrCodeUrl,false, 6)->entry();
|
$qrCodeFile = $qrCode->png($qrCodeUrl,false, 6)->entry();
|
||||||
Plant::where('id',$params['plant_id'])->update([
|
Plant::where('id',$params['plant_id'])->update([
|
||||||
'status'=>2,
|
'status'=>2,
|
||||||
'qr_code' => empty($qrCodeFile) ? '' : $qrCodeFile
|
'qr_code' => empty($qrCodeFile) ? '' : $qrCodeFile,
|
||||||
|
'harvest_date' => time(),
|
||||||
]);
|
]);
|
||||||
Land::where('id',$plant['land_id'])->update([
|
Land::where('id',$plant['land_id'])->update([
|
||||||
'residual_area'=>$land['residual_area']+$plant['area'],
|
'residual_area'=>$land['residual_area']+$plant['area'],
|
||||||
|
|
|
@ -144,7 +144,9 @@ class IndexController extends BaseApiController
|
||||||
return $this->fail('土地信息错误');
|
return $this->fail('土地信息错误');
|
||||||
}
|
}
|
||||||
$plantInfo['pic'] = json_decode($plantInfo['pic'],true);
|
$plantInfo['pic'] = json_decode($plantInfo['pic'],true);
|
||||||
|
$plantInfo['group_day'] = floor(($plantInfo['harvest_date'] - $plantInfo['plant_date']) / 86400);
|
||||||
$plantInfo['plant_date'] = date('Y-m-d',$plantInfo['plant_date']);
|
$plantInfo['plant_date'] = date('Y-m-d',$plantInfo['plant_date']);
|
||||||
|
$plantInfo['harvest_date'] = date('Y-m-d',$plantInfo['harvest_date']);
|
||||||
$plantInfo['land_name'] = $landInfo['title'];
|
$plantInfo['land_name'] = $landInfo['title'];
|
||||||
$plantInfo['land_area'] = $landInfo['total_area'];
|
$plantInfo['land_area'] = $landInfo['total_area'];
|
||||||
$plantInfo['land_address'] = $landInfo['province_name'].$landInfo['city_name'].$landInfo['county_name'].$landInfo['town_name'].$landInfo['village_name'].$landInfo['group_name'];
|
$plantInfo['land_address'] = $landInfo['province_name'].$landInfo['city_name'].$landInfo['county_name'].$landInfo['town_name'].$landInfo['village_name'].$landInfo['group_name'];
|
||||||
|
|
Loading…
Reference in New Issue