Commit 0f18c375 authored by hujun's avatar hujun

agentBargainIncome

parent 9f5357ab
...@@ -640,7 +640,7 @@ class OBargainModel extends Model ...@@ -640,7 +640,7 @@ class OBargainModel extends Model
if (isset($params["create_time"])) { if (isset($params["create_time"])) {
$where_["c.income_time"] = $params["create_time"]; $where_["c.income_time"] = $params["create_time"];
} }
$where_["status"] = array( "in", "10,11,13" );
return Db::table($this->table) return Db::table($this->table)
->field($field) ->field($field)
->alias("a") ->alias("a")
...@@ -1702,4 +1702,22 @@ class OBargainModel extends Model ...@@ -1702,4 +1702,22 @@ class OBargainModel extends Model
->where($where) ->where($where)
->find(); ->find();
} }
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function agentBargainIncome($field, $where) {
return $this->db_->alias('a')
->field($field)
->join('a_agents b', 'a.agent_id = b.id', 'left')
->join('o_partial_commission c', 'a.id = c.bargain_id', 'left')
->join('o_real_income d', 'c.real_income_id = d.id', 'left')
->where($where)
->select();
}
} }
\ 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