Commit 51a4a1c2 authored by hujun's avatar hujun

审核

parent da1f08c1
......@@ -808,6 +808,14 @@ class Finance extends Basic
$where['a.agent_id'] = $this->params['agent_id'];
}
if (isset($this->params['is_self']) && $this->params['is_self'] != -1) {
if ($this->params['is_self']) {
$where['e.operation_id'] = $this->userId;
} else {
$where['e.operation_id'] = ['<>', $this->userId];
}
}
$fields = 'a.create_time,a.id,a.order_id,a.pay_log_id,a.refund_money,a.type,a.agent_id,a.agent_name,b.house_id,a.status,';
$fields .= 'd.income_time,a.type,c.store_id';
$list = $refund->getCheckRefundList($pageNo, $pageSize, 'a.id DESC', $fields, $where);
......
......@@ -212,14 +212,17 @@ class ORefundModel extends Model{
* @throws \think\exception\DbException
*/
public function getCheckRefundList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '') {
return Db::table($this->table)
->alias('a')
return $this->db_->alias('a')
->field($field)
->join('o_report b', 'a.report_id = b.id', 'left')
->join('o_financial_audit c', 'a.order_id=c.order_id', 'left')
->join('o_order b', 'a.order_id = b.id', 'left')
->join('a_agents c', 'a.agent_id = c.id', 'left')
->join('o_paylog d', 'a.pay_log_id = d.id', 'left')
->join('o_refund_log e', 'a.id = e.refund_id', 'left')
->where($params)
->limit($pageSize)
->page($pageNo)
->order($order_)
->group('a.id')
->select();
}
......@@ -230,10 +233,37 @@ class ORefundModel extends Model{
* @return int|string
*/
public function getCheckRefundListTotal($params) {
return Db::table($this->table)
->alias('a')
->join('o_report b', 'a.report_id = b.id', 'left')
->join('o_financial_audit c', 'a.order_id=c.order_id', 'left')
return $this->db_->alias('a')
->join('o_order b', 'a.order_id = b.id', 'left')
->join('a_agents c', 'a.agent_id = c.id', 'left')
->join('o_paylog d', 'a.pay_log_id = d.id', 'left')
->join('o_refund_log e', 'a.id = e.refund_id', 'left')
->where($params)
->group('a.id')
->count();
}
/**
* @param $params
* @return float|int
*/
public function getSumMoney($params) {
return $this->db_->alias('a')
->join('o_order b', 'a.order_id = b.id', 'left')
->join('a_agents c', 'a.agent_id = c.id', 'left')
->join('o_paylog d', 'a.pay_log_id = d.id', 'left')
->join('o_refund_log e', 'a.id = e.refund_id', 'left')
->where($params)
->group('a.id')
->sum('a.refund_money');
}
/**
* @param $data
* @param $where
* @return ORefundModel
*/
public function updateData($data, $where) {
return $this->where($where)->update($data);
}
}
\ 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