First commit

This commit is contained in:
2025-10-02 10:33:06 +08:00
parent 198b8bf2a6
commit c38eed4a22
5512 changed files with 958855 additions and 0 deletions

46
app/farm/model/ClaimHarvest.php Executable file
View File

@@ -0,0 +1,46 @@
<?php
namespace app\farm\model;
use app\BaseModel;
use think\facade\Db;
use think\facade\Log;
class ClaimHarvest extends BaseModel
{
//定义表名
protected $name = 'lbfarm_claim_harvest';
public function getList($claim_id){
return $this->where(['claim_id'=>$claim_id])->select();
}
public function claimHarvestUpdate($claimSpecList,$claim_id){
$ids = [];
$claimSpecList = json_decode($claimSpecList,true);
Log::write($claimSpecList);
Log::write('11--');
foreach ($claimSpecList as $item) {
$info = $this->where(['id'=>$item['id']])->find();
if (!$info){
$info = new ClaimHarvest();
$info['claim_id'] = $claim_id;
}
$info['harvest_name'] = $item['harvest_name'];
$info['harvest'] = $item['harvest'];
$info->save();
array_push($ids,$info['id']);
}
$this->whereNotIn('id',$ids)->where('claim_id',$claim_id)->delete();
}
public function getSpecInfo($spec_id){
return $this->find($spec_id);
}
}