CollocationModel.php
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/12/27
* Time: 16:34
*/
namespace app\index\model;
use think\Model;
class CollocationModel extends Model
{
//保单总数
public function collocationCount($where){
$where['delete_time'] = ['eq',0];
$data = $this->where($where)->count();
return $data;
}
//被保人数
public function peopleCount($where){
$where['delete_time'] = ['eq',0];
$data = $this->where($where)->group('insurer')->count();
return $data;
}
//本年保险支出
public function totalSum($where){
$where['delete_time'] = ['=',0];
// $where['expire_time'] = ['>',time()];//判断保单是否还在缴费期限内
$data= $this->where($where)->sum('insurance_price');
return $data;
}
//获取全部被保人
public function insurerData($where,$group = null){
$where['delete_time'] = ['eq',0];
$data = $this->where($where)->group($group)->select()->toArray();
return $data;
}
public function findData($where){
$data = $this
->alias('c')
->field('c.*,i_c.insurance_company_name')
->join('cmf_insurance_company i_c','i_c.id = c.insurance_company_id')
->where($where)->find();
return $data;
}
}