Commit 4c2d0048 authored by hujun's avatar hujun

财务日志

parent 1e062124
......@@ -13,6 +13,7 @@ use app\api_broker\service\OrderLogService;
use app\index\extend\Basic;
use app\index\untils\ExportExcelUntil;
use app\model\AAgents;
use app\model\OBargainLogModel;
use app\model\OBargainModel;
use app\model\ORealIncome;
use app\model\OTaxes;
......@@ -1025,6 +1026,11 @@ class Finance extends Basic
if (!empty($this->params['bargain_start_date']) && !empty($this->params['bargain_end_date'])) {
$where['a.create_time'] = [ 'between time', [ $this->params['bargain_start_date'] . ' 00:00:00', $this->params['bargain_end_date'] . '23:59:59' ] ];
}
/**部门id**/
if (!empty($this->params['district_id'])) {
$where['d.district_id'] = $this->params['district_id'];
}
/**提交成交报告日期 end**/
//
// /**开票日期 start**/
......@@ -1052,10 +1058,7 @@ class Finance extends Basic
// $where['d.name'] = [ 'like', '%' . $this->params['name'] . '%' ];
// }
//
// /**部门id**/
// if (!empty($this->params['district_id'])) {
// $where['d.district_id'] = $this->params['district_id'];
// }
//
// /**门店名**/
// if (!empty($this->params['store_name'])) {
......@@ -1186,11 +1189,61 @@ class Finance extends Basic
return $this->response($code, $msg);
}
/**
* 财务日志
*
* @return \think\Response|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function financeUpdateLog(){
if (!$this->request->isAjax()) {
return view('finance/finance_update_log');
}
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$where = [];
if (!empty($this->params['create_time']) && empty($this->params['end_time'])) {
$where['a.create_time'] = ['> time', $this->params['create_time']];
}
if (!empty($this->params['end_time']) && empty($this->params['create_time'])) {
$where['a.create_time'] = ['< time', $this->params['create_time']];
}
if (!empty($this->params['create_time']) && !empty($this->params['end_time'])) {
$where['a.create_time'] = ['between time', [$this->params['create_time'], $this->params['end_time']]];
}
//商铺号
if (!empty($this->params['house_number'])) {
$where['a.house_number'] = ['like', '%'.$this->params['house_number'].'%'];
}
//商铺地址
if (!empty($this->params['house_address'])) {
$where['a.step_content'] = ['like', '%'.$this->params['house_address'].'%'];
}
//经纪人名字
if (!empty($this->params['name'])) {
$where['b.name'] = ['like', '%'.$this->params['name'].'%'];
}
//经纪人手机号
if (!empty($this->params['phone'])) {
$where['b.name'] = ['like', '%'.$this->params['phone'].'%'];
}
$fields = 'a.create_time,step_content,b.name,b.phone';
$m_log = new OBargainLogModel();
$data['list'] = $m_log->getLogAgent($pageNo, $pageSize, 'a.id desc', $fields, $where);
$data['total'] = $m_log->getLogAgentTotal($where);
return $this->response(200, "", $data);
}
/**
......
......@@ -46,4 +46,41 @@ class OBargainLogModel extends BaseModel
return 0;
}
}
/**
* 查询列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getLogAgent($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '') {
return $this->field($field)
->alias('a')
->join('a_agents b', 'a.operation_id = b.id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
}
/**
* 查询列表
*
* @param $params
* @return int|string
*/
public function getLogAgentTotal($params) {
return $this->alias('a')
->join('a_agents b', 'a.operation_id = b.id', 'left')
->where($params)
->count();
}
}
\ 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