Commit 220aaa63 authored by zhuwei's avatar zhuwei

业绩明细

parent f52e8332
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/4/24
* Time: 16:55
*/
namespace app\index\controller;
use app\index\extend\Basic;
use app\model\OBargainModel;
class PerformanceInfo extends Basic
{
protected $oBargainModel;
public function __construct($request = null)
{
parent::__construct($request);
$this->oBargainModel = new OBargainModel();
}
/**
* 业绩明细
*/
public function performanceInfo() {
if (!$this->request->isAjax()) {
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$where=[];
/*开始结束时间*/
if (($this->params['start_date'] != NULL) && ($this->params['end_date'] != NULL)) {
$where['create_time'] = ['between time', [$this->params['start_date'] . ' 00:00:00'], $this->params['end_date'] . ' 23:59:59'];
}
//todo 成交类型
if ($this->params['trade_type'] != NULL) {
$where['Obargain.trade_type'] = $this->params['trade_type'];
}
//todo 商铺地址
if ($this->params['landmark'] != NULL) {
$where['Houses.landmark'] = ['like', '%'.$this->params['landmark'].'%'];
}
//todo 商铺编号
if ($this->params['houses_id'] != NULL) {
$where['Houses.houses_id'] = $this->params['houses_id'];
}
//todo 部门
if ($this->params['district_id'] != NULL) {
$where['District.id'] = $this->params['district_id'] ;
}
//todo 门店
if ($this->params['store_id'] != NULL) {
$where['Store.id'] = $this->params['store_id'] ;
}
//todo 姓名
if ($this->params['name'] != NULL) {
$where['Agent.name'] = ['like', '%'.$this->params['name'].'%'];
}
//todo 手机号
if ($this->params['phone'] != NULL) {
$where['Agent.phone'] = ['like', '%'.$this->params['phone'].'%'];
}
$field = 'Obargain.create_time,';
$field .= 'Obargain.trade_type,';
$field .= 'Obargain.scale,';
$field .= 'Obargain.scale_fee,';
$field .= 'Obargain.practical_fee,';
$field .= 'Agent.name,';
$field .= 'Agent.phone,';
$field .= 'Store.store_name,';
$field .= 'District.district_name,';
$field .= 'Houses.landmark,';
$field .= 'Oorder.house_id';
$return = $this->oBargainModel->performancelInfo($where,$field,$pageSize,$pageNo);
return $this->response(200, '', $return);
} else {
return view('performanceInfo');
}
}
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment