Commit ff8aee8a authored by hujun's avatar hujun

预警

parent 997f8a7f
......@@ -3194,14 +3194,6 @@ class Finance extends Basic
$where['a.order_id'] = $this->params['order_id'];
}
if (!empty($this->params['bargain_id'])) {
$where['a.bargain_id'] = $this->params['bargain_id'];
}
if (!empty($this->params['source_type'])) {
$where['a.bargain_id'] = $this->params['bargain_id'];
}
if (is_numeric($this->params['source_type'])) {
if ($this->params['source_type'] == 1) {
$where['a.source'] = array('neq', 2);
......
......@@ -2490,4 +2490,72 @@ class OfficePayLog extends Basic
}
}
/**
* 办公楼收款预警
*
* @return \think\Response
*/
public function intentionsWarning()
{
if (!$this->request->isAjax()) {
return view('payLog/intentions_warning');
}
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$data = [];
$where['a.is_del'] = 0;
$where['a.source'] = ['<', 2];
$msg = '';
if (!empty($this->params['transfer_start_time']) && !empty($this->params['transfer_end_time'])) {
$where['a.last_transfer_time'] = ['between', [$this->params['transfer_start_time'] . ' 00:00:00', $this->params['transfer_end_time'] . ' 23:59:59']];
}
//商铺ID
if (!empty($this->params['house_id'])) {
$where['b.house_id'] = $this->params['house_id'];
}
//提交人所在门店
if (!empty($this->params['store_id'])) {
$where['e.store_id'] = $this->params['store_id'];
}
//提交人所在部门
if (!empty($this->params['district_id'])) {
$where['e.district_id'] = $this->params['district_id'];
}
//提交人姓名
if (!empty($this->params['agent_id'])) {
$where['a.agent_id'] = $this->params['agent_id'];
}
if (!empty($this->params['bargain_id'])) {
$where['a.bargain_id'] = $this->params['bargain_id'];
}
if (!empty($this->params['pay_id'])) {
$where['a.id'] = $this->params['pay_id'];
}
if (!empty($this->params['order_id'])) {
$where['a.order_id'] = $this->params['order_id'];
}
try {
$order = new OfficeOPayLogModel();
$field = 'a.create_time,a.id,a.order_id,a.bargain_id,a.income_time,c.name,a.real_money';
$list = $order->getPayLogOrderListLimit($pageNo, $pageSize, $order_ = 'a.id desc', $field, $where);
$data['total'] = $order->getPayLogOrderListLimitTotal($where);
$data['list'] = $list;
} catch (\Exception $e) {
$msg = '内部错误:' . $e->getMessage();
}
return $this->response(200, $msg, $data);
}
}
\ No newline at end of file
......@@ -10,13 +10,70 @@ namespace app\index\controller;
use app\index\extend\Basic;
use app\model\OPayLogModel;
class PayLog extends Basic
{
public function intentionsWarning()
{
if(!$this->request->isAjax()) {
if (!$this->request->isAjax()) {
return view('intentions_warning');
}
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$data = [];
$where['a.is_del'] = 0;
$where['a.source'] = ['<', 2];
$msg = '';
if (!empty($this->params['transfer_start_time']) && !empty($this->params['transfer_end_time'])) {
$where['a.last_transfer_time'] = ['between', [$this->params['transfer_start_time'] . ' 00:00:00', $this->params['transfer_end_time'] . ' 23:59:59']];
}
//商铺ID
if (!empty($this->params['house_id'])) {
$where['b.house_id'] = $this->params['house_id'];
}
//提交人所在门店
if (!empty($this->params['store_id'])) {
$where['e.store_id'] = $this->params['store_id'];
}
//提交人所在部门
if (!empty($this->params['district_id'])) {
$where['e.district_id'] = $this->params['district_id'];
}
//提交人姓名
if (!empty($this->params['agent_id'])) {
$where['a.agent_id'] = $this->params['agent_id'];
}
if (!empty($this->params['bargain_id'])) {
$where['a.bargain_id'] = $this->params['bargain_id'];
}
if (!empty($this->params['pay_id'])) {
$where['a.id'] = $this->params['pay_id'];
}
if (!empty($this->params['order_id'])) {
$where['a.order_id'] = $this->params['order_id'];
}
try {
$order = new OPayLogModel();
$field = 'a.create_time,a.id,a.order_id,a.bargain_id,a.income_time,c.name,a.real_money';
$list = $order->getPayLogOrderListLimit($pageNo, $pageSize, $order_ = 'a.id desc', $field, $where);
$data['total'] = $order->getPayLogOrderListLimitTotal($where);
$data['list'] = $list;
} catch (\Exception $e) {
$msg = '内部错误:' . $e->getMessage();
}
return $this->response(200, $msg, $data);
}
}
\ No newline at end of file
......@@ -737,4 +737,42 @@ class OPayLogModel extends Model
->where($params)
->select();
}
/**
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getPayLogOrderListLimit($pageNo = 1, $pageSize = 15, $order_ = 'a.id desc', $field = '', $params = '')
{
$params["a.is_del"] = 0;
return $this->db_->field($field)
->alias("a")
->join("o_order b", "a.order_id = b.id", "left")
->join('a_agents c', 'a.agent_id=c.id', 'left')
->limit($pageSize)
->page($pageNo)
->order($order_)
->where($params)
->select();
}
/**
* @param string $params
* @param string $field
* @return int|string
*/
public function getPayLogOrderListLimitTotal($params = '', $field = 'a.id')
{
$params["a.is_del"] = 0;
return $this->db_->field($field)
->alias("a")
->join("o_order b", "a.order_id = b.id", "left")
->join('a_agents c', 'a.agent_id=c.id', 'left')
->where($params)
->count($field);
}
}
\ No newline at end of file
......@@ -694,4 +694,42 @@ class OfficeOPayLogModel extends Model
{
return $this->db_->where($where)->update($data);
}
/**
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getPayLogOrderListLimit($pageNo = 1, $pageSize = 15, $order_ = 'a.id desc', $field = '', $params = '')
{
$params["a.is_del"] = 0;
return $this->db_->field($field)
->alias("a")
->join("o_order b", "a.order_id = b.id", "left")
->join('a_agents c', 'a.agent_id=c.id', 'left')
->limit($pageSize)
->page($pageNo)
->order($order_)
->where($params)
->select();
}
/**
* @param string $params
* @param string $field
* @return int|string
*/
public function getPayLogOrderListLimitTotal($params = '', $field = 'a.id')
{
$params["a.is_del"] = 0;
return $this->db_->field($field)
->alias("a")
->join("o_order b", "a.order_id = b.id", "left")
->join('a_agents c', 'a.agent_id=c.id', 'left')
->where($params)
->count($field);
}
}
\ No newline at end of file
......@@ -1213,6 +1213,7 @@ Route::group('office_index', [
'searchBargainAgents' => ['index/OfficeBargain/searchBargainAgents', ['method' => 'GET']], //成交报告id获取盘方,客方,反签,独家,合作方
'collectingBill' => ['index/officePayLog/collectingBill', ['method' => 'get|post']], //收款
'getBeForNum' => ['index/officePayLog/getBeForNum', ['method' => 'get']],//获取上次提交收款的门牌号等
'intentionsWarning' => ['index/officePayLog/intentionsWarning', ['method' => 'GET']],//意向金预警
'inspectionRecordOur/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 0]], //我的约带看
'inspectionRecordStore/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 1]], //门店约带看
......
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