86 lines
2.5 KiB
PHP
86 lines
2.5 KiB
PHP
<?php
|
|
namespace app\model;
|
|
use think\Db;
|
|
use think\db\Where;
|
|
|
|
class CebCheckApply extends Base
|
|
{
|
|
/**
|
|
* 获取光大银行核价列表
|
|
* @Author llz
|
|
* @DateTime 2023-03-20
|
|
* @version 2.0
|
|
* @param array $field 查询字段值
|
|
* @param array $where 查询条件
|
|
* @param array $paginate 分页设置
|
|
* @return array
|
|
*/
|
|
public function getCheckApplyList($page,$limit, $handle_status){
|
|
|
|
|
|
$where = new Where();
|
|
/*if($handle_status != 'all') {
|
|
$where['handle_status'] = $handle_status;
|
|
}*/
|
|
|
|
$res = Db::name('ceb_check_apply')->alias('cca')
|
|
->leftJoin('pg_inquiry pi','pi.business_no = cca.business_no')
|
|
->leftJoin('pg_property_cert_info pid','pid.quot_id= pi.id')
|
|
->leftJoin('ceb_check_result ccr','ccr.business_no= cca.business_no')
|
|
->field('cca.*,ccr.check_status, if(cca.update_time,cca.update_time,cca.create_time) as time')
|
|
->field('pid.property_full_name,pi.bank_name,pi.bank_sub_name,pi.bank_customer_mgr_name')
|
|
->order("time","desc")
|
|
->group('pid.quot_id')
|
|
// ->page($page)
|
|
// ->limit($limit)
|
|
->select();
|
|
return $res;
|
|
}
|
|
public function updateCheckApplyStatus($businessNo,$status) {
|
|
$res = Db::name('ceb_check_apply')->where('business_no', $businessNo)
|
|
->update(['is_check' => $status]);
|
|
}
|
|
|
|
public function addCheckApply(array $data){
|
|
Db::startTrans();
|
|
|
|
$this->business_no = $data['businessNo'];
|
|
$this->company_code = $data['companyCode'];
|
|
$this->check_apply = $data['checkApply'];
|
|
|
|
if (isset($data['estimateDealNo'])) {
|
|
$this->estimate_deal_no = $data['estimateDealNo'];
|
|
}
|
|
|
|
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->is_check = 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 getCheckTotal(){
|
|
return Db::name('ceb_check_apply')->where('is_check=1')->count();
|
|
}
|
|
|
|
|
|
}
|
|
?>
|