Files
pgserver3.0/pgserver/application/model/ZongdiInfo.php
annnj-company 130c1026c4 first commit
2026-04-17 18:29:53 +08:00

52 lines
1.1 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace app\model;
use think\Db;
use think\Log;
/**
* Class 宗地表
* @package app\model
* @author: bordon
*/
class ZongdiInfo extends Base
{
/**
* 数据来源 0 正常1 批量上传
*
* @var integer
*/
public static $SRC_TYPE_NORMAL = 0; // 正常类
public static $SRC_TYPE_BATCH = 1; // 批量上传类
/**
* 保存宗地信息
*
* @param [type] $data 宗地表结构一致
* @return void
*/
public function AddorUpdateByZdbh( $data )
{
// 构建查询条件
//$map['id'] = $data['id'];
$map['parcel_no'] = $data['parcel_no'];
$zd_id = isset($data['zd_id'])?$data['zd_id']:null;
// 查询是否存在符合条件的记录
$record = $this->where($map)->find();
$r = null;
if ($record&&$zd_id != null ) {
// 符合条件的记录已存在,做更新操作
$r = $this->where($map)->update($data);
} else {
$r = $this->save($data);
$zd_id = $this->id;
}
return ['res'=>$r,'id'=>$zd_id];
}
}