Commit 466d8194 authored by zw's avatar zw

调整

parent 7aa8af94
...@@ -66,11 +66,11 @@ class OrderLogService ...@@ -66,11 +66,11 @@ 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, $income_time,0,0); $house_number, $industry_type, $remark, $transfer_img, $source, $income_time, 0, 0);
$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, $income_time,0,0)); $house_number, $industry_type, $remark, $transfer_img, $source, $income_time, 0, 0));
} }
} }
} }
...@@ -112,8 +112,8 @@ class OrderLogService ...@@ -112,8 +112,8 @@ 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, $income_time,$is_dividend, $industry_type, $remark, $transfer_img, $source, $income_time, $is_dividend,
$last_transfer_time,$pay_id) $last_transfer_time, $pay_id)
{ {
$bill_arr = $params = []; $bill_arr = $params = [];
$father_id = 0; $father_id = 0;
...@@ -121,18 +121,18 @@ class OrderLogService ...@@ -121,18 +121,18 @@ class OrderLogService
$type = 0; $type = 0;
foreach ($collecting_bill as $collecting) { foreach ($collecting_bill as $collecting) {
if (isset($collecting["type"]) && isset($collecting["pay_type"]) && isset($collecting["money"])) { if (isset($collecting["type"]) && isset($collecting["pay_type"]) && isset($collecting["money"])) {
if(!$this->verifyType($collecting["type"],$collecting["pay_type"],$last_transfer_time)){ if (!$this->verifyType($collecting["type"], $collecting["pay_type"], $is_dividend, $last_transfer_time)) {
return -1; return -1;
} }
$money = $collecting["money"]; $money = $collecting["money"];
$type = $collecting["type"]; $type = $collecting["type"];
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, $income_time,$is_dividend,$last_transfer_time); $house_number, $industry_type, $remark, $transfer_img, $source, $income_time, $is_dividend, $last_transfer_time);
$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, $income_time,$is_dividend,$last_transfer_time)); $house_number, $industry_type, $remark, $transfer_img, $source, $income_time, $is_dividend, $last_transfer_time));
} }
} }
} }
...@@ -140,9 +140,9 @@ class OrderLogService ...@@ -140,9 +140,9 @@ class OrderLogService
//保存图片 //保存图片
$oImgModel = new OImg(); $oImgModel = new OImg();
$oImgModel->addImgAll($father_id, 2, $transfer_img); $oImgModel->addImgAll($father_id, 2, $transfer_img);
if($pay_id > 0){ if ($pay_id > 0) {
$payLogService = new PayLogService(); $payLogService = new PayLogService();
$payLogService->addAdjustment($father_id,$pay_id,$money,$type,$agent_id); $payLogService->addAdjustment($father_id, $pay_id, $money, $type, $agent_id);
} }
$pushMarchIn = new PushMessageService(); $pushMarchIn = new PushMessageService();
...@@ -161,39 +161,67 @@ class OrderLogService ...@@ -161,39 +161,67 @@ class OrderLogService
* @param $last_transfer_time * @param $last_transfer_time
* @return bool * @return bool
*/ */
private function verifyType($type,$pay_type,$last_transfer_time){ private function verifyType($type, $pay_type, $is_dividend, $last_transfer_time)
{
switch ($type){ switch ($pay_type) {
case 10: case 10:
break;
case 11: case 11:
break;
case 20: case 20:
break;
case 21: case 21:
break;
case 30: case 30:
break;
case 40: case 40:
break;
case 41: case 41:
break;
case 42: case 42:
break;
case 50: case 50:
break;
case 60: case 60:
break; break;
default: default:
return false; return false;
} }
switch ($pay_type){ switch ($type) {
case 10: case 10:
case 20: if (!$last_transfer_time) {
return false;
}
break;
case 30: case 30:
if (!$last_transfer_time) {
return false;
}
break;
case 20:
break;
case 40: case 40:
break;
case 50: case 50:
break;
case 60: case 60:
break;
case 70: case 70:
break;
case 80: case 80:
break;
case 90: case 90:
if(!$last_transfer_time){ break;
case 91:
if (!$is_dividend) {
return false; return false;
} }
break; break;
case 91:
case 92: case 92:
if (!$is_dividend) {
return false;
}
break; break;
default: default:
return false; return false;
...@@ -220,7 +248,7 @@ class OrderLogService ...@@ -220,7 +248,7 @@ class OrderLogService
* @return mixed * @return mixed
*/ */
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, $income_time,$is_dividend,$last_transfer_time) $industry_type, $remark, $transfer_img, $source, $income_time, $is_dividend, $last_transfer_time)
{ {
$arr["report_id"] = $report_id; $arr["report_id"] = $report_id;
...@@ -242,10 +270,10 @@ class OrderLogService ...@@ -242,10 +270,10 @@ class OrderLogService
if ($income_time) { if ($income_time) {
$arr["income_time"] = date("Y-m-d H:i:s", $income_time); $arr["income_time"] = date("Y-m-d H:i:s", $income_time);
} }
if($is_dividend){ if ($is_dividend) {
$arr["is_dividend"] = $is_dividend; $arr["is_dividend"] = $is_dividend;
} }
if($last_transfer_time){ if ($last_transfer_time) {
$arr["last_transfer_time"] = date("Y-m-d H:i:s", $income_time); $arr["last_transfer_time"] = date("Y-m-d H:i:s", $income_time);
} }
...@@ -512,7 +540,7 @@ class OrderLogService ...@@ -512,7 +540,7 @@ class OrderLogService
foreach ($marchInData as $k => $v) { foreach ($marchInData as $k => $v) {
$v["step_name"] = "march_in"; $v["step_name"] = "march_in";
$v["img_path"] = CHAT_IMG_URL; $v["img_path"] = CHAT_IMG_URL;
$v["img"] = $this->getOImg($v["id"],1); $v["img"] = $this->getOImg($v["id"], 1);
$result[$sort++] = $v; $result[$sort++] = $v;
} }
} }
...@@ -569,7 +597,8 @@ class OrderLogService ...@@ -569,7 +597,8 @@ class OrderLogService
return $this->sortByTime($result); return $this->sortByTime($result);
} }
public function getOImg($id,$img_type)
public function getOImg($id, $img_type)
{ {
//查询图片 //查询图片
$oImgModel = new OImg(); $oImgModel = new OImg();
...@@ -578,6 +607,7 @@ class OrderLogService ...@@ -578,6 +607,7 @@ class OrderLogService
$img_arr = $oImgModel->getImgList($params); $img_arr = $oImgModel->getImgList($params);
return $img_arr; return $img_arr;
} }
public function arr2tree($list) public function arr2tree($list)
{ {
$tree = $trees = []; $tree = $trees = [];
...@@ -708,8 +738,8 @@ class OrderLogService ...@@ -708,8 +738,8 @@ class OrderLogService
//报备 //报备
foreach ($reportData as $k => $v) { foreach ($reportData as $k => $v) {
$v["step_name"] = "report"; $v["step_name"] = "report";
$house_title = mb_substr($v['house_title'],0,3,'utf-8')."***"; $house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$v["step"] = "报备【id:" .$v['house_id']." ". $house_title . "】"; $v["step"] = "报备【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
$order_ids .= $v["order_id"] . ","; $order_ids .= $v["order_id"] . ",";
...@@ -730,8 +760,8 @@ class OrderLogService ...@@ -730,8 +760,8 @@ class OrderLogService
if (count($marchInData) > 0) { if (count($marchInData) > 0) {
foreach ($marchInData as $k => $v) { foreach ($marchInData as $k => $v) {
$v["step_name"] = "march_in"; $v["step_name"] = "march_in";
$house_title = mb_substr($v['house_title'],0,3,'utf-8')."***"; $house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$v["step"] = "进场【id:" .$v['house_id']." ". $house_title . "】"; $v["step"] = "进场【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
} }
...@@ -759,8 +789,8 @@ class OrderLogService ...@@ -759,8 +789,8 @@ class OrderLogService
if (count($payLogData) > 0) { if (count($payLogData) > 0) {
foreach ($payLogData as $k => $v) { foreach ($payLogData as $k => $v) {
$v["step_name"] = "pay_log"; $v["step_name"] = "pay_log";
$house_title = mb_substr($v['house_title'],0,3,'utf-8')."***"; $house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$v["step"] = "收款【id:" .$v['house_id']." ". $house_title . "】"; $v["step"] = "收款【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
} }
...@@ -773,8 +803,8 @@ class OrderLogService ...@@ -773,8 +803,8 @@ class OrderLogService
if (count($refundData) > 0) { if (count($refundData) > 0) {
foreach ($refundData as $k => $v) { foreach ($refundData as $k => $v) {
$v["step_name"] = "refund"; $v["step_name"] = "refund";
$house_title = mb_substr($v['house_title'],0,3,'utf-8')."***"; $house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$v["step"] = "退款【id:" .$v['house_id']." ". $house_title . "】"; $v["step"] = "退款【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
} }
...@@ -785,8 +815,8 @@ class OrderLogService ...@@ -785,8 +815,8 @@ class OrderLogService
if (count($bargainData) > 0) { if (count($bargainData) > 0) {
foreach ($bargainData as $k => $v) { foreach ($bargainData as $k => $v) {
$v["step_name"] = "bargain"; $v["step_name"] = "bargain";
$house_title = mb_substr($v['house_title'],0,3,'utf-8')."***"; $house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$v["step"] = "成交报告【id:" .$v['house_id']." ". $house_title . "】"; $v["step"] = "成交报告【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
} }
...@@ -1032,7 +1062,7 @@ class OrderLogService ...@@ -1032,7 +1062,7 @@ class OrderLogService
* @throws \think\db\exception\BindParamException * @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException * @throws \think\exception\PDOException
*/ */
public function getSearchOrder($params,$pageNo,$pageSize) public function getSearchOrder($params, $pageNo, $pageSize)
{ {
$condition = $where_ = "1=1 "; $condition = $where_ = "1=1 ";
$field = "a.id,a.order_no,a.f_id,a.house_id,a.house_title,b.report_agent_id,b.report_agent_phone,b.report_agent_name, $field = "a.id,a.order_no,a.f_id,a.house_id,a.house_title,b.report_agent_id,b.report_agent_phone,b.report_agent_name,
...@@ -1069,7 +1099,7 @@ class OrderLogService ...@@ -1069,7 +1099,7 @@ class OrderLogService
$vModel = new VerifyService(); $vModel = new VerifyService();
$agentArr = $vModel->getAgentsByAgentId($params["agent_id"]); $agentArr = $vModel->getAgentsByAgentId($params["agent_id"]);
if(empty($agentArr)){ if (empty($agentArr)) {
return ["code" => "101", "msg" => "经纪人不存在"]; return ["code" => "101", "msg" => "经纪人不存在"];
} }
$where_ = $condition; $where_ = $condition;
...@@ -1091,7 +1121,7 @@ class OrderLogService ...@@ -1091,7 +1121,7 @@ class OrderLogService
$orderModel = new OrderModel(); $orderModel = new OrderModel();
$result = $orderModel->searchOrder($field, $condition, $where_,$pageNo,$pageSize); $result = $orderModel->searchOrder($field, $condition, $where_, $pageNo, $pageSize);
$ids_str = ""; $ids_str = "";
if (count($result) <= 0) { if (count($result) <= 0) {
...@@ -1123,7 +1153,7 @@ class OrderLogService ...@@ -1123,7 +1153,7 @@ class OrderLogService
* @throws \think\db\exception\BindParamException * @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException * @throws \think\exception\PDOException
*/ */
public function getSearchOrderByAll($params,$pageNo,$pageSize) public function getSearchOrderByAll($params, $pageNo, $pageSize)
{ {
$condition = $where_ = "1=1 "; $condition = $where_ = "1=1 ";
$field = "a.id,a.order_no,a.f_id,a.house_id,a.house_title,b.report_agent_id,b.report_agent_phone,b.report_agent_name, $field = "a.id,a.order_no,a.f_id,a.house_id,a.house_title,b.report_agent_id,b.report_agent_phone,b.report_agent_name,
...@@ -1160,7 +1190,7 @@ class OrderLogService ...@@ -1160,7 +1190,7 @@ class OrderLogService
$orderModel = new OrderModel(); $orderModel = new OrderModel();
$result = $orderModel->searchOrderAll($field, $condition, $where_,$pageNo,$pageSize); $result = $orderModel->searchOrderAll($field, $condition, $where_, $pageNo, $pageSize);
$ids_str = ""; $ids_str = "";
if (count($result) <= 0) { if (count($result) <= 0) {
......
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