201 lines
7.1 KiB
PHP
201 lines
7.1 KiB
PHP
<?php
|
|
namespace app\model;
|
|
use think\Db;
|
|
use think\db\Where;
|
|
|
|
class CebInquiryApply extends Base
|
|
{
|
|
/**
|
|
* 获取光大银行询价申请列表
|
|
* @Author llz
|
|
* @DateTime 2023-03-10
|
|
* @version 2.0
|
|
* @param array $field 查询字段值
|
|
* @param array $where 查询条件
|
|
* @param array $paginate 分页设置
|
|
* @return array
|
|
*/
|
|
public function getInquiryApply($page,$limit, $handle_status,$business_no){
|
|
|
|
$paginate = [
|
|
'list_rows' => $limit,
|
|
'page' => $page
|
|
];
|
|
$where = new Where();
|
|
|
|
$where['cia.business_no'] = $business_no;
|
|
|
|
|
|
$res = Db::name('ceb_inquiry_apply')->alias("cia")
|
|
->leftJoin('pg_inquiry pi','pi.business_no = cia.business_no')
|
|
//->leftJoin('pg_property_cert_info pid','pid.quot_id= pi.id')
|
|
->field('cia.*,if(cia.update_time,cia.update_time,cia.create_time) as time')
|
|
->field('pi.bank_name,pi.bank_sub_name,pi.bank_customer_mgr_name')
|
|
->order("time","desc")
|
|
->where($where)
|
|
->paginate($paginate);
|
|
return $res;
|
|
}
|
|
/**
|
|
* 获取光大银行询价申请列表
|
|
* @Author llz
|
|
* @DateTime 2023-03-10
|
|
* @version 2.0
|
|
* @param array $field 查询字段值
|
|
* @param array $where 查询条件
|
|
* @param array $paginate 分页设置
|
|
* @return array
|
|
*/
|
|
public function getInquiryApplyList($page,$limit, $handle_status,$business_no,$keyword){
|
|
|
|
$paginate = [
|
|
'list_rows' => $limit,
|
|
'page' => $page
|
|
];
|
|
|
|
$where = null;
|
|
if ($business_no != '1') {
|
|
$where['cia.business_no'] = $business_no;
|
|
} else if ($keyword) {
|
|
$where['cia.business_no'] = $keyword;
|
|
}
|
|
|
|
$res = Db::name('ceb_inquiry_apply')->alias("cia")
|
|
// ->leftJoin('pg_inquiry pi','pi.business_no = cia.business_no')
|
|
//->leftJoin('pg_property_cert_info pid','pid.quot_id= pi.id')
|
|
->field('cia.id,cia.business_no,cia.estimate_times, cia.regist_date,cia.land_limit_date,cia.house_purpose, cia.regist_price, cia.is_return,cia.business_type,cia.file_name, cia.phone_number, cia.manager_name, cia.owner_name, cia.covered_area, cia.file_end, cia.file_path , cia.business_line_type,cia.certificate_no,cia.create_date,cia.update_time as time')
|
|
// ->field('pi.bank_name,pi.bank_sub_name,pi.bank_customer_mgr_name,cia.business_no as business_no')
|
|
->where($where)
|
|
->where('cia.update_time','>','2023-06-30')
|
|
->order("is_return asc, time desc ")
|
|
//->group('pid.quot_id')
|
|
->paginate($paginate);
|
|
return $res;
|
|
}
|
|
|
|
public function updateInquiryApplyStatus($businessNo,$status) {
|
|
$res = Db::name('ceb_inquiry_apply')->where('business_no', $businessNo)
|
|
->update(['is_return' => $status]);
|
|
}
|
|
|
|
/**
|
|
* 获取银行新请求数量
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getNewInquiryCount()
|
|
{
|
|
return Db::name('ceb_inquiry_apply')->where( ['is_return'=>'1'])->count();
|
|
}
|
|
|
|
public function addInquiryApply($interface_type,array $data){
|
|
Db::startTrans();
|
|
|
|
$this->business_no = $data['businessNo'];
|
|
$this->company_code = $data['companyCode'];
|
|
$this->business_type = $data['businessType'];
|
|
$this->collateral_type = $data['collateralType'];
|
|
$this->province_id = $data['provinceId'];
|
|
$this->city_id = $data['cityId'];
|
|
if (isset($data['custName'])) {
|
|
$this->cust_name = $data['custName'];
|
|
}
|
|
|
|
$this->business_line_type = $data['businessLineType'];
|
|
if (isset($data['certificateNo'])) {
|
|
$this->certificate_no = $data['certificateNo'];
|
|
}
|
|
|
|
$this->estimate_times = $data['estimateTimes'];
|
|
//$fileType = json_decode($data['propertyCardType']);
|
|
//$filename = $data['bankPreEstimateNo'] . "." . $fileType[0];
|
|
//$this->property_card = $filename;
|
|
//$fileDataArray = json_decode($data['propertyCard']);
|
|
//$fileData = base64_decode($fileDataArray[0]);
|
|
//$filename = "C:\\phpstudy_pro\\WWW\\PGEvaSysVue\\" . $filename;
|
|
//file_put_contents($filename,$fileData);//写入文件并保存
|
|
|
|
if (isset($data['propertyName'])) {
|
|
$this->property_name = $data['propertyName'];
|
|
}
|
|
if (isset($data['coveredArea'])) {
|
|
$this->covered_area = $data['coveredArea'];
|
|
}
|
|
if (isset($data['registPrice'])) {
|
|
$this->regist_price = $data['registPrice'];
|
|
}
|
|
if (isset($data['registDate'])) {
|
|
$this->regist_date = $data['registDate'];
|
|
}
|
|
if (isset($data['ownerName'])) {
|
|
$this->owner_name = $data['ownerName'];
|
|
}
|
|
if (isset($data['phoneNumber'])) {
|
|
$this->phone_number = $data['phoneNumber'];
|
|
}
|
|
if (isset($data['managerName'])) {
|
|
$this->manager_name = $data['managerName'];
|
|
}
|
|
if (isset($data['landLimitDate'])) {
|
|
$this->land_limit_date = $data['landLimitDate'];
|
|
}
|
|
if (isset($data['housePurpose'])) {
|
|
$this->house_purpose = $data['housePurpose'];
|
|
}
|
|
if (isset($data['collateralName'])) {
|
|
$this->collateral_name = $data['collateralName'];
|
|
}
|
|
if (isset($data['collateralNum'])) {
|
|
$this->collateral_num = $data['collateralNum'];
|
|
}
|
|
|
|
if (isset($data['certificateNo'])) {
|
|
$this->certificate_no = $data['certificateNo'];
|
|
}
|
|
if (isset($data['fileName'])) {
|
|
$this->file_name = $data['fileName'];
|
|
}
|
|
if (isset($data['fileEnd'])) {
|
|
$this->file_end = $data['fileEnd'];
|
|
}
|
|
if (isset($data['filePath'])) {
|
|
$this->file_path = $data['filePath'];
|
|
}
|
|
if (isset($data['field1'])) {
|
|
$this->field1 = $data['field1'];
|
|
}
|
|
if (isset($data['field2'])) {
|
|
$this->field2 = $data['field2'];
|
|
}
|
|
if (isset($data['field3'])) {
|
|
$this->field3 = $data['field3'];
|
|
}
|
|
|
|
$this->create_date = $data['createTime'];
|
|
$this->interface_type = $interface_type;
|
|
$this->is_return = 1;
|
|
|
|
|
|
$this->create_time = date('Y-m-d H:i:s');
|
|
$this->update_time = date('Y-m-d H:i:s');
|
|
|
|
if (!$this->save()){
|
|
Db::rollback();
|
|
return false;
|
|
}
|
|
Db::commit();
|
|
return true;
|
|
}
|
|
public function isBusinessNoLinkInquiry($business_no) {
|
|
|
|
if(!Db::name('inquiry')->where(['business_no' => $business_no])->find()){
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public function getInquiryTotal(){
|
|
return Db::name('ceb_inquiry_apply')->where('is_return=1')->count();
|
|
}
|
|
}
|
|
?>
|