Commit 939b4f0e authored by hujun's avatar hujun

修改获取最后一次分佣比例用到新增税费开票

parent 7a9443c5
......@@ -197,8 +197,9 @@ class OPartialCommission extends BaseModel
* @throws \think\exception\PDOException
*/
public function getBragainScale(int $bargain_id) {
$sql = 'SELECT scale,agent_id,role,substring_index(group_concat(id ORDER BY id DESC),",",1) as id
FROM o_partial_commission WHERE bargain_id = '.$bargain_id.' GROUP BY role';
$sql = 'SELECT a.scale,a.agent_id,a.role,substring_index(group_concat(a.id ORDER BY a.id DESC),",",1) AS id
FROM o_partial_commission a LEFT JOIN o_bargain b on a.bargain_id=b.id WHERE a.bargain_id = '.$bargain_id.'
and b.id= '.$bargain_id.' OR b.father_id='.$bargain_id.' GROUP BY role';
return $this->query($sql);
}
}
\ 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