Commit be58cd41 authored by hujun's avatar hujun

更新成交报告分佣方

parent dd86d955
......@@ -17,7 +17,7 @@ class OBargainModel extends Model
protected $table = "o_bargain";
private $db_;
function __construct()
public function __construct()
{
$this->db_ = Db::name($this->table);
}
......@@ -173,6 +173,14 @@ class OBargainModel extends Model
->select();
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getBargainByOrderId($field, $params)
{
$where_ = [];
......@@ -642,6 +650,14 @@ class OBargainModel extends Model
return $data;
}
/**
* @param $params
* @param $type
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAddBargainNum($params, $type)
{
$where_ = [];
......@@ -687,6 +703,13 @@ class OBargainModel extends Model
return $return;
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getReceived($params)
{
$where_ = [];
......@@ -711,6 +734,16 @@ class OBargainModel extends Model
}
/**
* @param $page_no
* @param $page_size
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getReceivedList($page_no, $page_size, $field, $params)
{
$where_ = [];
......@@ -737,6 +770,16 @@ class OBargainModel extends Model
}
/**
* @param $params
* @param $field
* @param $page_no
* @param $page_size
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAddBargainList($params, $field, $page_no, $page_size)
{
$where_ = [];
......@@ -763,6 +806,15 @@ class OBargainModel extends Model
->select();
}
/**
* @param $field
* @param $params
* @param $is_case
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAddBargainOrderList($field, $params, $is_case)
{
$where_ = [];
......@@ -1172,11 +1224,15 @@ class OBargainModel extends Model
/**
* 获取分组统计数据
*
* @param $field
* @param $params
* @param $type
* @param string $order
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getTotalByAgentId($field, $params, $type, $order = "")
{
......@@ -1208,7 +1264,16 @@ class OBargainModel extends Model
}
/**
* @param $where
* @param $filed
* @param $pageSize
* @param $pageNo
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function performancelInfo($where, $filed, $pageSize, $pageNo)
{
$result = $this->db_
......@@ -1229,6 +1294,11 @@ class OBargainModel extends Model
return $result;
}
/**
* @param $where
* @param $filed
* @return int|string
*/
public function performancelInfoTotal($where, $filed)
{
$result = $this->db_
......@@ -1245,4 +1315,23 @@ class OBargainModel extends Model
// echo $this->db_->getLastSql();
return $result;
}
/**
* 根据成交报告id修改信息
*
* @param int $id
* @param array $data
* @return int
*/
public function updateBargain(int $id = 0, array $data = []) : int {
if ($id) {
$result = $this->where('id',$id)
->whereOr('father_id', $id)
->insertGetId($data);
} else {
$result = 0;
}
return $result;
}
}
\ No newline at end of file
......@@ -49,22 +49,21 @@ class OFinancialAudit extends BaseModel
}
/**
* 修改信息
*
* @param $id
* @param $params
* @return int
* @throws \think\exception\PDOException
*/
public function updateBargainById($id, $params)
{
$params["update_time"] = date("Y-m-d H:i:s", time());
Db::startTrans();
$this->startTrans();
try {
$this->db_->where('id', $id)->update($params);
Db::commit();
$this->where('id', $id)->update($params);
$this->commit();
return 1;
} catch (\Exception $e) {
Db::rollback();
$this->rollback();
return 0;
}
}
......
......@@ -79,7 +79,7 @@ class ResultsSummaryNewTask
* @param $agent_id
* @param $store_id
* @param $district_id
* @param $total_time 比如修改了数据如成交报告,成交报告提交时间是昨天那么这里的时间就是昨天
* @param $total_time string 比如修改了数据如成交报告,成交报告提交时间是昨天那么这里的时间就是昨天
*/
public function updateTotalByAgentId($agent_id,$store_id,$district_id,$total_time)
{
......
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