Commit fc44a179 authored by clone's avatar clone

新增成交报告门牌号和是否开业

parent 3efd1f16
...@@ -109,10 +109,10 @@ class OrderLog extends Basic ...@@ -109,10 +109,10 @@ class OrderLog extends Basic
$transfer_img = isset($params["transfer_img"]) ? $params["transfer_img"] : ""; $transfer_img = isset($params["transfer_img"]) ? $params["transfer_img"] : "";
$source = $params["source"] ? $params["source"] : 0; $source = $params["source"] ? $params["source"] : 0;
$is_ok = $this->service_->addCollectingBill($params["agent_id"], $params["agent_name"], $params["report_id"], $params["order_id"], $params["order_no"], $is_ok = $this->service_->addCollectingBill($params["agent_id"], $params["agent_name"], $params["report_id"], $params["order_id"], $params["order_no"],
$params["collecting_bill"], $params["house_number"], $params["industry_type"], $remark, $transfer_img,$source); $params["collecting_bill"], $params["house_number"], $params["industry_type"], $remark, $transfer_img, $source);
if ($is_ok > 0) { if ($is_ok > 0) {
return $this->response("200", "request success", ["bill_id"=> $is_ok]); return $this->response("200", "request success", [ "bill_id" => $is_ok ]);
} }
return $this->response("101", "request faild"); return $this->response("101", "request faild");
} }
...@@ -121,20 +121,21 @@ class OrderLog extends Basic ...@@ -121,20 +121,21 @@ class OrderLog extends Basic
* 获取上次提交付款的门牌号业态等 * 获取上次提交付款的门牌号业态等
* @return \think\Response * @return \think\Response
*/ */
public function getBeforeBillInfo(){ public function getBeforeBillInfo()
{
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"order_id" => 15523, //关联order表id "order_id" => 15523, //关联order表id
);*/ );*/
if ( !isset($params["order_id"])) { if (!isset($params["order_id"])) {
return $this->response("101", "订单编号不能为空"); return $this->response("101", "订单编号不能为空");
} }
$billInfo = $this->service_->getBillInfo($params["order_id"]); $billInfo = $this->service_->getBillInfo($params["order_id"]);
if(count($billInfo) > 0 ){ if (count($billInfo) > 0) {
return $this->response("200","request success",$billInfo[0]); return $this->response("200", "request success", $billInfo[0]);
}else{ } else {
return $this->response("200","request null"); return $this->response("200", "request null");
} }
} }
...@@ -142,7 +143,8 @@ class OrderLog extends Basic ...@@ -142,7 +143,8 @@ class OrderLog extends Basic
* 保存pos机收款记录 * 保存pos机收款记录
* @return \think\Response * @return \think\Response
*/ */
public function savePosBillMessage(){ public function savePosBillMessage()
{
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"p_id" => 50, "p_id" => 50,
...@@ -150,15 +152,15 @@ class OrderLog extends Basic ...@@ -150,15 +152,15 @@ class OrderLog extends Basic
"pay_time"=>time(), "pay_time"=>time(),
"real_money" => 11.12 "real_money" => 11.12
);*/ );*/
if(!isset($params["p_id"]) || !isset($params["trade_no"]) if (!isset($params["p_id"]) || !isset($params["trade_no"])
|| !isset($params["pay_time"]) || !isset($params["real_money"])){ || !isset($params["pay_time"]) || !isset($params["real_money"])) {
return $this->response("101","请求参数错误"); return $this->response("101", "请求参数错误");
} }
$is_ok = $this->service_->updateBillInfo($params["p_id"],$params["trade_no"],$params["pay_time"],$params["real_money"]); $is_ok = $this->service_->updateBillInfo($params["p_id"], $params["trade_no"], $params["pay_time"], $params["real_money"]);
if($is_ok > 0){ if ($is_ok > 0) {
return $this->response("200","支付成功!"); return $this->response("200", "支付成功!");
}else{ } else {
return $this->response("101","支付失败!"); return $this->response("101", "支付失败!");
} }
} }
...@@ -208,6 +210,7 @@ class OrderLog extends Basic ...@@ -208,6 +210,7 @@ class OrderLog extends Basic
if (!isset($params["submit_agent_id"]) || !isset($params["submit_agent_name"]) || !isset($params["report_id"]) || if (!isset($params["submit_agent_id"]) || !isset($params["submit_agent_name"]) || !isset($params["report_id"]) ||
!isset($params["order_id"]) || !isset($params["order_no"]) || !isset($params["trade_type"]) || !isset($params["order_id"]) || !isset($params["order_no"]) || !isset($params["trade_type"]) ||
!isset($params["house_number"]) || !isset($params["is_open"]) ||
!isset($params["price"]) || !isset($params["commission"]) || !isset($params["commission_arr"])) { !isset($params["price"]) || !isset($params["commission"]) || !isset($params["commission_arr"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
...@@ -217,7 +220,8 @@ class OrderLog extends Basic ...@@ -217,7 +220,8 @@ class OrderLog extends Basic
"report_id" => 1,//报备id "report_id" => 1,//报备id
"order_id" => 1, //关联order表id "order_id" => 1, //关联order表id
"order_no" => "123123123", //订单no "order_no" => "123123123", //订单no
"house_number" =>"门牌号",
"is_open" => 0,//是否开业,0未开业 1开业
"trade_type" => 10, //成交类型 10出租 20 增佣 30 代理 40 好处费 "trade_type" => 10, //成交类型 10出租 20 增佣 30 代理 40 好处费
"price" => 112131, //成交价格 存分 "price" => 112131, //成交价格 存分
"commission" => 111, //佣金 存分 "commission" => 111, //佣金 存分
...@@ -234,7 +238,7 @@ class OrderLog extends Basic ...@@ -234,7 +238,7 @@ class OrderLog extends Basic
$params["commission_arr"] = json_decode($params["commission_arr"], true); $params["commission_arr"] = json_decode($params["commission_arr"], true);
$is_ok = $this->service_->addBargain($params["submit_agent_id"], $params["submit_agent_name"], $params["report_id"], $params["order_id"], $params["order_no"], $is_ok = $this->service_->addBargain($params["submit_agent_id"], $params["submit_agent_name"], $params["report_id"], $params["order_id"], $params["order_no"],
$params["trade_type"], $params["price"], $params["commission"], $params["commission_arr"]); $params["trade_type"], $params["price"], $params["commission"], $params["commission_arr"], $params["house_number"], $params["is_open"]);
if ($is_ok > 0) { if ($is_ok > 0) {
//todo 更改用户信息 求租->已租 //todo 更改用户信息 求租->已租
...@@ -521,7 +525,7 @@ class OrderLog extends Basic ...@@ -521,7 +525,7 @@ class OrderLog extends Basic
$data['msg'] = ""; $data['msg'] = "";
$data['data'] = []; $data['data'] = [];
if (empty($this->params['id']) || empty($this->params['agent_id']) || empty($this->params['source']) ) { if (empty($this->params['id']) || empty($this->params['agent_id']) || empty($this->params['source'])) {
return $this->response(101, 'Id or agent_id or source is null.'); return $this->response(101, 'Id or agent_id or source is null.');
} }
...@@ -603,12 +607,13 @@ class OrderLog extends Basic ...@@ -603,12 +607,13 @@ class OrderLog extends Basic
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function getIsAccountStatement(){ public function getIsAccountStatement()
{
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"order_id" => 7353, "order_id" => 7353,
);*/ );*/
if(!isset($params["order_id"])){ if (!isset($params["order_id"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
$field = "id,order_id,account_statement"; $field = "id,order_id,account_statement";
...@@ -616,11 +621,14 @@ class OrderLog extends Basic ...@@ -616,11 +621,14 @@ class OrderLog extends Basic
$where_["father_id"] = 0; $where_["father_id"] = 0;
$where_["account_statement"] = 0; $where_["account_statement"] = 0;
$oBargainModel = new OBargainModel(); $oBargainModel = new OBargainModel();
$data = $oBargainModel->selectBargainByOrderNo($field,$where_,"id desc"); $data = $oBargainModel->selectBargainByOrderNo($field, $where_, "id desc");
if(count($data) > 0){ if (count($data) > 0) {
return $this->response("200","request success",["bargain_id" => $data[0]["id"]]); $list["bargain_id"] = $data[0]["id"];
}else{ $list["house_number"] = $data[0]["house_number"];
return $this->response("200","request null"); $list["is_open"] = $data[0]["is_open"];
return $this->response("200", "request success", $list);
} else {
return $this->response("200", "request null");
} }
} }
} }
\ No newline at end of file
...@@ -117,12 +117,15 @@ class OrderLogService ...@@ -117,12 +117,15 @@ class OrderLogService
* @param $price * @param $price
* @param $commission * @param $commission
* @param $commission_arr * @param $commission_arr
* @param $house_number
* @param $is_open
* @return int|string * @return int|string
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @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, $commission, $commission_arr) 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)
{ {
$bargain_arr = []; $bargain_arr = [];
$father_id = 0; $father_id = 0;
...@@ -132,11 +135,11 @@ class OrderLogService ...@@ -132,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); $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)); $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"] ]);
...@@ -157,7 +160,8 @@ class OrderLogService ...@@ -157,7 +160,8 @@ class OrderLogService
return $father_id; return $father_id;
} }
private function bargainBin($father_id, $commission_val, $submit_agent_id, $submit_agent_name, $report_id, $order_id, $order_no, $trade_type, $price, $commission) 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)
{ {
$arr["report_id"] = $report_id; $arr["report_id"] = $report_id;
$arr["father_id"] = $father_id; $arr["father_id"] = $father_id;
...@@ -172,6 +176,8 @@ class OrderLogService ...@@ -172,6 +176,8 @@ class OrderLogService
$arr["agent_id"] = $commission_val["agent_id"]; $arr["agent_id"] = $commission_val["agent_id"];
$arr["scale"] = $commission_val["scale"]; $arr["scale"] = $commission_val["scale"];
$arr["scale_fee"] = $commission_val["scale_fee"]; $arr["scale_fee"] = $commission_val["scale_fee"];
$arr["house_number"] = $house_number;
$arr["is_open"] = $is_open;
$arr["create_time"] = date("Y-m-d H:i:s", time()); $arr["create_time"] = date("Y-m-d H:i:s", time());
$arr["update_time"] = date("Y-m-d H:i:s", time()); $arr["update_time"] = date("Y-m-d H:i:s", time());
return $arr; return $arr;
......
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