Commit 104ede14 authored by hujun's avatar hujun

办公楼成功报告

parent 023d25f0
This diff is collapsed.
......@@ -1630,4 +1630,69 @@ class OfficeOBargainModel extends Model
->where($where)
->find();
}
/**
* 成交报告列表
*
* @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 getBargainList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '')
{
return $this->db_->field($field)->alias('a')
->join('office_o_report b', 'a.report_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left')
->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_o_partial_commission e', 'a.id = e.bargain_id', 'left')
->join('office_g_building f', 'd.building_id=f.id','left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->group('a.id')
->select();
}
/**
* 成交报告总数
*
* @param array $params
* @return int
*/
public function getBargainTotal(array $params = [])
{
return $this->db_->alias('a')
->join('office_o_report b', 'a.report_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left')
->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_o_partial_commission e', 'a.id = e.bargain_id', 'left')
->join('office_g_building f', 'd.building_id=f.id','left')
->where($params)
->group('a.id')
->count();
}
/**
* @param string $field
* @param string $params
* @return float|int
*/
public function getBargainListSum($field = '', $params = '')
{
return $this->db_->alias('a')
->join('office_o_report b', 'a.report_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left')
->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_o_partial_commission e', 'a.id = e.bargain_id', 'left')
->join('office_g_building f', 'd.building_id=f.id','left')
->where($params)
->sum($field);
}
}
\ No newline at end of file
......@@ -460,7 +460,7 @@ class OfficeOMarchInModel extends Model
$data['data'] = $this->db_model->field($field)
->alias('a')
->join('a_agents b', 'a.reception_id = b.id', 'left')
->join('o_bargain c', 'a.order_id = c.order_id', 'left')
->join('office_o_bargain c', 'a.order_id = c.order_id', 'left')
->where($where)
->select();
$data['status'] = 'successful';
......
This diff is collapsed.
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/5/23
* Time: 17:46
*/
namespace app\model;
class OfficeORealIncome extends BaseModel
{
/**
* 增加实收佣金
*
* @param $insert_data
* @return array|false
* @throws \Exception
*/
public function addRealIncome($insert_data) {
return $this->saveAll($insert_data);
}
/**
* @param int $bargain_id
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getBargainTaxes(int $bargain_id, $field = 'id as fee_id,money,income_time') {
return $this->field($field)
->where('bargain_id', $bargain_id)
->where('is_del', 0)
->select();
}
/**
* @param int $bargain_id
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getBargainIncome(int $bargain_id, $field = 'id as fee_id,money,income_time') {
return $this->field($field)
->where('bargain_id', $bargain_id)
->where('is_del', 0)
->find();
}
/**
* @param int $bargain_id
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getIncome($where, $field = 'id as fee_id,money,income_time') {
$where['is_del'] = 0;
return $this->field($field)
->where($where)
->find();
}
/**
* @param int $field
* @param array $where
* @return array
*/
public function getBargainTaxesColumn($field, array $where) {
return $this->field($field)
->where($where)
->column($field);
}
/**
* @param string $field
* @param $where
* @return mixed
*/
public function getRealIncomeBargain($field = 'id as fee_id,money,income_time', $where) {
try {
$where['is_del'] = 0;
$result['data'] = $this->field($field)
->where($where)
->select();
$result['status'] = 'successful';
} catch (\Exception $e) {
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
}
return $result;
}
/**
* @param $field
* @param $where
* @return float|int
*/
public function sumField($field, $where) {
return $this->where($where)
->sum($field);
}
/**
* @param string $field
* @param string $params
* @return float|int
*/
public function getIncomeListSum($field = '', $params = '')
{
return $this->alias('e')
->join('office_o_report b', 'a.report_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left')
->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_o_partial_commission e', 'a.id = e.bargain_id', 'left')
->join('office_g_building f', 'd.building_id=f.id','left')
->where($params)
->sum($field);
}
/**
* @param $field
* @param $where
* @return mixed
*/
public function getFieldValue($field, $where) {
return $this->where($where)->value($field);
}
}
\ No newline at end of file
......@@ -1071,6 +1071,11 @@ Route::group('office_index', [
'getDistance' => ['index/OfficeManage/getDistance', ['method' => 'GET']], //获取两个经纬度距离
'getHouseAddress' => ['index/OfficeRoom/checkRepetition', ['method' => 'get']], //搜索楼号/栋/座+楼层+房号
'marchInList' => ['index/officeMarchIn/marchInList', ['method' => 'POST|GET']], //进场记录列表 朱伟 2018-06-13
'reportListOne/:check_status' => ['index/OfficeBargain/reportList', ['method' => 'get'], ['check_status' => 1]], //财务 成交报告-未结单-第一级审核
'reportListTwo/:check_status' => ['index/OfficeBargain/reportList', ['method' => 'get'], ['check_status' => 2]], //财务 成交报告-未结单-第二级审核
'reportListThree/:check_status' => ['index/OfficeBargain/reportList', ['method' => 'get'], ['check_status' => 3]], //财务 成交报告-未结单-第三级审核
'reportListStatement/:check_status' => ['index/OfficeBargain/reportList', ['method' => 'get'], ['check_status' => 4]], //财务 成交报告-已结单
'reportListAll/:check_status' => ['index/OfficeBargain/reportList', ['method' => 'get'], ['check_status' => 10]], //财务 成交报告-全部
]);
Route::group('office_api', [
......
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