Commit 466d8194 authored by zw's avatar zw

调整

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