Commit f38b4140 authored by clone's avatar clone

我的成交

parent 989c7b58
...@@ -420,17 +420,10 @@ class OrderLog extends Basic ...@@ -420,17 +420,10 @@ class OrderLog extends Basic
public function bargainDetail() public function bargainDetail()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"bargain_id" => 6, "bargain_id" => 169,
"house_id" => 1,
"house_title"=> "wwww",
"internal_address" =>"ewewerwer",
"user_id" => 1,
"user_name" =>"nihhkkk",
"user_phone"=>"123****3333"
);*/ );*/
if (!isset($params["bargain_id"]) || !isset($params["house_id"]) || !isset($params["house_title"]) || !isset($params["internal_address"]) if (!isset($params["bargain_id"])) {
|| !isset($params["user_id"]) || !isset($params["user_name"]) || !isset($params["user_phone"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
......
...@@ -55,7 +55,7 @@ class OrderLogService ...@@ -55,7 +55,7 @@ class OrderLogService
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function addCollectingBill($agent_id, $agent_name, $report_id, $order_id, $order_no, $collecting_bill, $house_number, public function addCollectingBill($agent_id, $agent_name, $report_id, $order_id, $order_no, $collecting_bill, $house_number,
$industry_type, $remark, $transfer_img,$source) $industry_type, $remark, $transfer_img, $source)
{ {
$bill_arr = $params = []; $bill_arr = $params = [];
$father_id = 0; $father_id = 0;
...@@ -63,15 +63,15 @@ class OrderLogService ...@@ -63,15 +63,15 @@ class OrderLogService
if (isset($collecting["type"]) && isset($collecting["pay_type"]) && isset($collecting["money"])) { if (isset($collecting["type"]) && isset($collecting["pay_type"]) && isset($collecting["money"])) {
if ($father_id == 0) { if ($father_id == 0) {
$params = $this->collectingBillBin($father_id, $collecting, $agent_id, $agent_name, $report_id, $order_id, $order_no, $params = $this->collectingBillBin($father_id, $collecting, $agent_id, $agent_name, $report_id, $order_id, $order_no,
$house_number, $industry_type, $remark, $transfer_img,$source); $house_number, $industry_type, $remark, $transfer_img, $source);
$father_id = $this->payLogModel->insertPayLog($params); $father_id = $this->payLogModel->insertPayLog($params);
} else { } else {
array_push($bill_arr, $this->collectingBillBin($father_id, $collecting, $agent_id, $agent_name, $report_id, $order_id, $order_no, array_push($bill_arr, $this->collectingBillBin($father_id, $collecting, $agent_id, $agent_name, $report_id, $order_id, $order_no,
$house_number, $industry_type, $remark, $transfer_img,$source)); $house_number, $industry_type, $remark, $transfer_img, $source));
} }
} }
} }
if($father_id > 0){ if ($father_id > 0) {
$pushMarchIn = new PushMessageService($params["report_id"], 2); $pushMarchIn = new PushMessageService($params["report_id"], 2);
$pushMarchIn->pushMarchInMessage($params["report_id"], 2); //推送 $pushMarchIn->pushMarchInMessage($params["report_id"], 2); //推送
} }
...@@ -83,7 +83,7 @@ class OrderLogService ...@@ -83,7 +83,7 @@ class OrderLogService
} }
private function collectingBillBin($father_id, $collecting_arr, $agent_id, $agent_name, $report_id, $order_id, $order_no, $house_number, private function collectingBillBin($father_id, $collecting_arr, $agent_id, $agent_name, $report_id, $order_id, $order_no, $house_number,
$industry_type, $remark, $transfer_img,$source) $industry_type, $remark, $transfer_img, $source)
{ {
$arr["report_id"] = $report_id; $arr["report_id"] = $report_id;
...@@ -125,7 +125,7 @@ class OrderLogService ...@@ -125,7 +125,7 @@ class OrderLogService
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function addBargain($submit_agent_id, $submit_agent_name, $report_id, $order_id, $order_no, $trade_type, $price, public function addBargain($submit_agent_id, $submit_agent_name, $report_id, $order_id, $order_no, $trade_type, $price,
$commission, $commission_arr,$house_number, $is_open) $commission, $commission_arr, $house_number, $is_open)
{ {
$bargain_arr = []; $bargain_arr = [];
$father_id = 0; $father_id = 0;
...@@ -135,11 +135,11 @@ class OrderLogService ...@@ -135,11 +135,11 @@ class OrderLogService
&& isset($commission_val["scale_fee"])) { && isset($commission_val["scale_fee"])) {
if ($father_id == 0) { if ($father_id == 0) {
$params = $this->bargainBin($father_id, $commission_val, $submit_agent_id, $submit_agent_name, $report_id, $order_id, $params = $this->bargainBin($father_id, $commission_val, $submit_agent_id, $submit_agent_name, $report_id, $order_id,
$order_no, $trade_type, $price, $commission,$house_number, $is_open); $order_no, $trade_type, $price, $commission, $house_number, $is_open);
$father_id = $this->bargainModel->insertBargain($params); $father_id = $this->bargainModel->insertBargain($params);
} else { } else {
array_push($bargain_arr, $this->bargainBin($father_id, $commission_val, $submit_agent_id, $submit_agent_name, $report_id, array_push($bargain_arr, $this->bargainBin($father_id, $commission_val, $submit_agent_id, $submit_agent_name, $report_id,
$order_id, $order_no, $trade_type, $price, $commission,$house_number, $is_open)); $order_id, $order_no, $trade_type, $price, $commission, $house_number, $is_open));
} }
} }
array_push($agent_arr, [ $commission_val["agent_id"] ]); array_push($agent_arr, [ $commission_val["agent_id"] ]);
...@@ -161,7 +161,7 @@ class OrderLogService ...@@ -161,7 +161,7 @@ class OrderLogService
} }
private function bargainBin($father_id, $commission_val, $submit_agent_id, $submit_agent_name, $report_id, $order_id, private function bargainBin($father_id, $commission_val, $submit_agent_id, $submit_agent_name, $report_id, $order_id,
$order_no, $trade_type, $price, $commission,$house_number, $is_open) $order_no, $trade_type, $price, $commission, $house_number, $is_open)
{ {
$arr["report_id"] = $report_id; $arr["report_id"] = $report_id;
$arr["father_id"] = $father_id; $arr["father_id"] = $father_id;
...@@ -726,8 +726,8 @@ class OrderLogService ...@@ -726,8 +726,8 @@ class OrderLogService
$where_ = $condition; $where_ = $condition;
if ($agentArr) { if ($agentArr) {
$params["report_agent_id"] = $agentArr; $params["report_agent_id"] = $agentArr;
$params["agent_id_s"] = array("in",$agentArr); $params["agent_id_s"] = array( "in", $agentArr );
$condition .= "and b.report_agent_id in (" . trim($agentArr) . ") "; $condition .= "and b.report_agent_id in (" . trim($agentArr) . ") ";
} }
$caseHouseId = $vModel->getCaseHouseIdByAgentId($params["agent_id_s"]); $caseHouseId = $vModel->getCaseHouseIdByAgentId($params["agent_id_s"]);
...@@ -735,8 +735,8 @@ class OrderLogService ...@@ -735,8 +735,8 @@ class OrderLogService
foreach ($caseHouseId as $item) { foreach ($caseHouseId as $item) {
$ids .= $item["houses_id"] . ","; $ids .= $item["houses_id"] . ",";
} }
$ids = rtrim($ids, ","); $ids = rtrim($ids, ",");
$ids = $ids ? $ids : 0; $ids = $ids ? $ids : 0;
$where_ .= "and a.house_id in ($ids)"; $where_ .= "and a.house_id in ($ids)";
...@@ -810,22 +810,25 @@ class OrderLogService ...@@ -810,22 +810,25 @@ class OrderLogService
public function getBargainDetail($params) public function getBargainDetail($params)
{ {
$bargainModel = new OBargainModel(); $bargainModel = new OBargainModel();
$bargain_info_filed = "a.id,a.house_number,a.is_open,a.trade_type,a.price,a.commission,c.id,c.internal_title, $bargain_info_filed = "a.id,a.house_number,a.is_open,a.trade_type,a.price,a.commission,c.id,c.internal_title,
c.internal_address,d.user_id,d.user_phone,d.user_name"; c.internal_address,d.user_id,d.user_phone,d.user_name";
/** $result = [];
* ->join("o_order b" ,"a.order_id = b.id","left")
->join("g_houses c" ,"b.house_id = b.id","left")
->join("o_report d","a.report_id = d.id","left")
*/
$bargainInfo = $bargainModel->selectBargainDetail($bargain_info_filed, $params); $bargainInfo = $bargainModel->selectBargainDetail($bargain_info_filed, $params);
if(count($bargainInfo) > 0){
} $result["bargainInfo"] = $bargainInfo;
//分佣提成 //分佣提成
$cent_commission = [];
$result["cent_commission"] = $cent_commission;
//税费
$taxes = [];
$result["taxes"] = $taxes;
return $result;
} }
...@@ -908,9 +911,10 @@ class OrderLogService ...@@ -908,9 +911,10 @@ class OrderLogService
* @param $order_id * @param $order_id
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
*/ */
public function getBillInfo($order_id){ public function getBillInfo($order_id)
{
$filed = "house_number,industry_type"; $filed = "house_number,industry_type";
return $this->payLogModel->getBeforeBillInfo($filed,["order_id"=>$order_id]); return $this->payLogModel->getBeforeBillInfo($filed, [ "order_id" => $order_id ]);
} }
...@@ -922,10 +926,11 @@ class OrderLogService ...@@ -922,10 +926,11 @@ class OrderLogService
* @param $real_money * @param $real_money
* @return false|int * @return false|int
*/ */
public function updateBillInfo($id,$trade_no,$pay_time,$real_money){ public function updateBillInfo($id, $trade_no, $pay_time, $real_money)
$params["id"] = $id; {
$params["trade_no"] = $trade_no; $params["id"] = $id;
$params["pay_time"] = date("Y-m-d H:i:s",$pay_time); $params["trade_no"] = $trade_no;
$params["pay_time"] = date("Y-m-d H:i:s", $pay_time);
$params["real_money"] = $real_money; $params["real_money"] = $real_money;
return $this->payLogModel->updatePayLog($params); return $this->payLogModel->updatePayLog($params);
......
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