Commit 96b5c7f5 authored by hujun's avatar hujun

bargain_id

parent a85326ab
......@@ -2450,109 +2450,113 @@ class Finance extends Basic
$is_show = 0;
$msg = '';
try {
$order = new OPayLogModel();
/*提交时间 start*/
if (!empty($this->params['start_time']) && empty($this->params['end_time'])) {
$where['a.create_time'] = ['> time', $this->params['start_time'] . ' 00:00:00'];
$is_show = 1;
}
/*提交时间 start*/
if (!empty($this->params['start_time']) && empty($this->params['end_time'])) {
$where['a.create_time'] = ['> time', $this->params['start_time'] . ' 00:00:00'];
$is_show = 1;
}
if (!empty($this->params['end_time']) && empty($this->params['start_time'])) {
$where['a.create_time'] = ['< time', $this->params['end_time'] . ' 23:59:59'];
$is_show = 1;
}
if (!empty($this->params['end_time']) && empty($this->params['start_time'])) {
$where['a.create_time'] = ['< time', $this->params['end_time'] . ' 23:59:59'];
$is_show = 1;
}
if (!empty($this->params['end_time']) && !empty($this->params['start_time'])) {
$where['a.create_time'] = ['between time', [
$this->params['start_time'] . ' 00:00:00', $this->params['end_time'] . ' 23:59:59'
]];
$is_show = 1;
}
/*提交时间 end*/
/*入账日期 start*/
if (!empty($this->params['income_start_time']) && empty($this->params['income_end_time'])) {
$where['a.income_time'] = ['> time', $this->params['income_start_time'] . ' 00:00:00'];
$is_show = 1;
}
if (!empty($this->params['end_time']) && !empty($this->params['start_time'])) {
$where['a.create_time'] = ['between time', [
$this->params['start_time'] . ' 00:00:00', $this->params['end_time'] . ' 23:59:59'
]];
$is_show = 1;
}
/*提交时间 end*/
/*入账日期 start*/
if (!empty($this->params['income_start_time']) && empty($this->params['income_end_time'])) {
$where['a.income_time'] = ['> time', $this->params['income_start_time'] . ' 00:00:00'];
$is_show = 1;
}
if (!empty($this->params['income_end_time']) && empty($this->params['income_start_time'])) {
$where['a.income_time'] = ['< time', $this->params['end_time'] . ' 23:59:59'];
$is_show = 1;
}
if (!empty($this->params['income_end_time']) && empty($this->params['income_start_time'])) {
$where['a.income_time'] = ['< time', $this->params['end_time'] . ' 23:59:59'];
$is_show = 1;
}
if (!empty($this->params['income_end_time']) && !empty($this->params['income_start_time'])) {
$where['a.income_time'] = ['between time', [
$this->params['income_start_time'] . ' 00:00:00', $this->params['income_end_time'] . ' 23:59:59'
]];
$is_show = 1;
}
/*入账日期 end*/
if (!empty($this->params['income_end_time']) && !empty($this->params['income_start_time'])) {
$where['a.income_time'] = ['between time', [
$this->params['income_start_time'] . ' 00:00:00', $this->params['income_end_time'] . ' 23:59:59'
]];
$is_show = 1;
}
/*入账日期 end*/
//商铺地址
if (!empty($this->params['internal_address'])) {
$where['d.internal_address'] = ['like', '%' . $this->params['internal_address'] . '%'];
$is_show = 1;
}
//商铺地址
if (!empty($this->params['internal_address'])) {
$where['d.internal_address'] = ['like', '%' . $this->params['internal_address'] . '%'];
$is_show = 1;
}
//商铺ID
if (!empty($this->params['house_id'])) {
$where['b.house_id'] = $this->params['house_id'];
$is_show = 1;
}
//商铺ID
if (!empty($this->params['house_id'])) {
$where['b.house_id'] = $this->params['house_id'];
$is_show = 1;
}
//提交人所在门店
if (!empty($this->params['store_id'])) {
$where['e.store_id'] = $this->params['store_id'];
$is_show = 1;
}
//提交人所在门店
if (!empty($this->params['store_id'])) {
$where['e.store_id'] = $this->params['store_id'];
$is_show = 1;
}
//提交人所在部门
if (!empty($this->params['district_id'])) {
$where['e.district_id'] = $this->params['district_id'];
$is_show = 1;
}
//提交人所在部门
if (!empty($this->params['district_id'])) {
$where['e.district_id'] = $this->params['district_id'];
$is_show = 1;
}
//提交人姓名
if (!empty($this->params['agent_id'])) {
$where['a.agent_id'] = $this->params['agent_id'];
$is_show = 1;
}
//提交人姓名
if (!empty($this->params['agent_id'])) {
$where['a.agent_id'] = $this->params['agent_id'];
$is_show = 1;
}
//入账方式
if (!empty($this->params['pay_type'])) {
$where['a.pay_type'] = $this->params['pay_type'];
$is_show = 1;
}
//入账方式
if (!empty($this->params['pay_type'])) {
$where['a.pay_type'] = $this->params['pay_type'];
$is_show = 1;
}
//入账类型
if (!empty($this->params['type'])) {
$where['a.type'] = $this->params['type'];
$is_show = 1;
}
//入账类型
if (!empty($this->params['type'])) {
$where['a.type'] = $this->params['type'];
$is_show = 1;
}
//来源
if ($this->params['source'] > -1) {
$where['a.source'] = $this->params['source'];
$is_show = 1;
}
//来源
if ($this->params['source'] > -1) {
$where['a.source'] = $this->params['source'];
$is_show = 1;
}
if (!empty($this->params['bargain_id'])) {
$order_id = $this->m_bargain->getFieldValue('order_id', ['id'=>$this->params['bargain_id'],'father_id'=>0]);
if (!empty($order_id)) {
$where[] = ['EXP', 'a.order_id='.$order_id];
}
$is_show = 1;
if (!empty($this->params['bargain_id'])) {
$order_id = $this->m_bargain->getFieldValue('order_id', ['id'=>$this->params['bargain_id'],'father_id'=>0]);
if (!empty($order_id)) {
$where[] = ['EXP', 'a.order_id='.$order_id];
}
$is_show = 1;
}
if (!empty($this->params['pay_id'])) {
$where['a.id'] = $this->params['pay_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'];
}
if (!empty($this->params['order_id'])) {
$where['a.order_id'] = $this->params['order_id'];
}
if (!empty($this->params['bargain_id'])) {
$where['a.bargain_id'] = $this->params['bargain_id'];
}
try {
$order = new OPayLogModel();
if (empty($this->params['excel'])) {
$field = 'a.id,a.create_time,a.order_id,a.father_id,a.money,a.real_money,a.pay_type,a.type,a.source,a.transaction_fee,a.source,b.f_id,a.transfer_name,a.receipt_number,';
$field .= 'e.name,a.income_time,e.store_id,b.house_id,b.order_no,a.report_id,a.house_number,a.is_dividend,a.last_transfer_time,a.industry_type,a.agent_id,d.internal_address as address,e.name as agent_name';
......
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