Commit d1a07866 authored by zw's avatar zw

报备增加搜索条件

parent 83527f24
...@@ -453,7 +453,7 @@ class OrderLog extends Basic ...@@ -453,7 +453,7 @@ class OrderLog extends Basic
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"type" => 1, //0.客户电话 1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址 "type" => 1, //0.客户电话 1.客户姓名,去掉 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址 6客户编号 7商铺编号
"agent_id" => 4022, "agent_id" => 4022,
"search_keyword" => "程" "search_keyword" => "程"
);*/ );*/
......
...@@ -61,7 +61,7 @@ class OrderLogService ...@@ -61,7 +61,7 @@ class OrderLogService
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function addCollectingBillV2($agent_id, $agent_name, $report_id, $order_id, $order_no, $collecting_bill, $house_number, public function addCollectingBillV2($agent_id, $agent_name, $report_id, $order_id, $order_no, $collecting_bill, $house_number,
$industry_type, $remark, $transfer_img, $source,$income_time) $industry_type, $remark, $transfer_img, $source, $income_time)
{ {
$bill_arr = $params = []; $bill_arr = $params = [];
$father_id = 0; $father_id = 0;
...@@ -69,11 +69,11 @@ class OrderLogService ...@@ -69,11 +69,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); $house_number, $industry_type, $remark, $transfer_img, $source, $income_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)); $house_number, $industry_type, $remark, $transfer_img, $source, $income_time));
} }
} }
} }
...@@ -139,7 +139,7 @@ class OrderLogService ...@@ -139,7 +139,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,$income_time) $industry_type, $remark, $transfer_img, $source, $income_time)
{ {
$arr["report_id"] = $report_id; $arr["report_id"] = $report_id;
...@@ -158,7 +158,7 @@ class OrderLogService ...@@ -158,7 +158,7 @@ class OrderLogService
$arr["transfer_img"] = $transfer_img; $arr["transfer_img"] = $transfer_img;
$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());
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);
} }
...@@ -204,7 +204,7 @@ class OrderLogService ...@@ -204,7 +204,7 @@ class OrderLogService
$order_id, $order_no, $trade_type, $price, $commission, $house_number, $is_open, $industry_type, $estimated_receipt_date)); $order_id, $order_no, $trade_type, $price, $commission, $house_number, $is_open, $industry_type, $estimated_receipt_date));
} }
} }
array_push($agent_arr, [ $commission_val["agent_id"] ]); array_push($agent_arr, [$commission_val["agent_id"]]);
} }
if ($father_id > 0) { //修改楼盘 if ($father_id > 0) { //修改楼盘
$houseNumUpdateService = new HouseNumUpdateService(); $houseNumUpdateService = new HouseNumUpdateService();
...@@ -291,19 +291,19 @@ class OrderLogService ...@@ -291,19 +291,19 @@ class OrderLogService
$oBargainModel = new OBargainModel(); $oBargainModel = new OBargainModel();
$orderData = $orderModel->selectOrderByOrderId("a.f_id,a.house_title,b.internal_address", [ "order_id" => $order_id ]); $orderData = $orderModel->selectOrderByOrderId("a.f_id,a.house_title,b.internal_address", ["order_id" => $order_id]);
//dump($orderData); //dump($orderData);
if (count($orderData) <= 0) { if (count($orderData) <= 0) {
return [ "101", "找不到此订单编号" ]; return ["101", "找不到此订单编号"];
} }
$report_id = $orderData[0]["f_id"]; $report_id = $orderData[0]["f_id"];
$field_report = "a.id,a.report_agent_id,a.report_agent_phone,a.report_agent_name,a.report_store_id, $field_report = "a.id,a.report_agent_id,a.report_agent_phone,a.report_agent_name,a.report_store_id,
a.user_id,a.user_phone,a.user_name,a.vehicle,a.intro,a.predict_see_time,a.create_time,b.store_name,c.district_name"; a.user_id,a.user_phone,a.user_name,a.vehicle,a.intro,a.predict_see_time,a.create_time,b.store_name,c.district_name";
$reportData = $oReportModel->selectReportInfoById($field_report, [ "id" => $report_id ]); $reportData = $oReportModel->selectReportInfoById($field_report, ["id" => $report_id]);
if (count($reportData) == 0) { if (count($reportData) == 0) {
return [ "101", "报备记录未找到" ]; return ["101", "报备记录未找到"];
} }
//报备 //报备
$reportData[0]["step_name"] = "report"; $reportData[0]["step_name"] = "report";
...@@ -313,7 +313,7 @@ class OrderLogService ...@@ -313,7 +313,7 @@ class OrderLogService
//进场 march in //进场 march in
$field_march_in = "id,reception_id,reception_name,report_id,order_no,march_in_remark,march_in_img,march_in_area,create_time"; $field_march_in = "id,reception_id,reception_name,report_id,order_no,march_in_remark,march_in_img,march_in_area,create_time";
$marchInData = $oMarchInModel->selectMarchInByOrderNo($field_march_in, [ "order_id" => $order_id ]); $marchInData = $oMarchInModel->selectMarchInByOrderNo($field_march_in, ["order_id" => $order_id]);
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";
...@@ -324,7 +324,7 @@ class OrderLogService ...@@ -324,7 +324,7 @@ class OrderLogService
//跟进 //跟进
$field_follow_up = "id,agent_id,agent_name,user_type,decision_maker,industry_type,area_requirement,price_requirement,province,city, $field_follow_up = "id,agent_id,agent_name,user_type,decision_maker,industry_type,area_requirement,price_requirement,province,city,
district,business_area,explain,explain_img,create_time"; district,business_area,explain,explain_img,create_time";
$followUpLogData = $followUpLogModel->selectFollowUpListByReportId($field_follow_up, [ "report_id" => $report_id ]); $followUpLogData = $followUpLogModel->selectFollowUpListByReportId($field_follow_up, ["report_id" => $report_id]);
if (count($followUpLogData) > 0) { if (count($followUpLogData) > 0) {
foreach ($followUpLogData as $k => $v) { foreach ($followUpLogData as $k => $v) {
...@@ -338,7 +338,7 @@ class OrderLogService ...@@ -338,7 +338,7 @@ class OrderLogService
//收款 //收款
$field_pay_log = "id,order_no,father_id,order_id,agent_id,agent_name,type,pay_type,money,house_number,industry_type, $field_pay_log = "id,order_no,father_id,order_id,agent_id,agent_name,type,pay_type,money,house_number,industry_type,
remark,transfer_img,real_money,source,create_time"; remark,transfer_img,real_money,source,create_time";
$payLogData = $oPayLogModel->selectPayLogByOrderNo($field_pay_log, [ "order_id" => $order_id ]); $payLogData = $oPayLogModel->selectPayLogByOrderNo($field_pay_log, ["order_id" => $order_id]);
if (count($payLogData) > 0) { if (count($payLogData) > 0) {
$sortPayLogData = $this->arr2tree($payLogData); $sortPayLogData = $this->arr2tree($payLogData);
foreach ($sortPayLogData as $k => $v) { foreach ($sortPayLogData as $k => $v) {
...@@ -351,7 +351,7 @@ class OrderLogService ...@@ -351,7 +351,7 @@ class OrderLogService
//退款 //退款
$field_refund = "id,report_id,agent_id,agent_name,order_no,order_id,refund_money,status,name,bank,card_no, $field_refund = "id,report_id,agent_id,agent_name,order_no,order_id,refund_money,status,name,bank,card_no,
remark,remark_img,create_time"; remark,remark_img,create_time";
$refundData = $oRefundModel->selectRefundByOrderNo($field_refund, [ "order_id" => $order_id ]); $refundData = $oRefundModel->selectRefundByOrderNo($field_refund, ["order_id" => $order_id]);
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";
...@@ -363,7 +363,7 @@ class OrderLogService ...@@ -363,7 +363,7 @@ class OrderLogService
//成交报告 //成交报告
$field_bargain = "a.id,a.father_id,a.house_number,a.is_open,a.report_id,a.order_id,a.trade_type,a.submit_agent_id,a.industry_type, $field_bargain = "a.id,a.father_id,a.house_number,a.is_open,a.report_id,a.order_id,a.trade_type,a.submit_agent_id,a.industry_type,
a.estimated_receipt_date,a.submit_agent_name, a.price,a.commission,a.role,a.agent_id,a.scale,a.scale_fee,a.create_time,b.name,b.phone,a.is_commission"; a.estimated_receipt_date,a.submit_agent_name, a.price,a.commission,a.role,a.agent_id,a.scale,a.scale_fee,a.create_time,b.name,b.phone,a.is_commission";
$bargainData = $oBargainModel->selectBargainListByOrderNo($field_bargain, [ "order_id" => $order_id ]); $bargainData = $oBargainModel->selectBargainListByOrderNo($field_bargain, ["order_id" => $order_id]);
if (count($bargainData) > 0) { if (count($bargainData) > 0) {
$bargain_data_arr = $this->arr2TreeBargain($bargainData); $bargain_data_arr = $this->arr2TreeBargain($bargainData);
foreach ($bargain_data_arr as $k2 => $v2) { foreach ($bargain_data_arr as $k2 => $v2) {
...@@ -455,7 +455,7 @@ class OrderLogService ...@@ -455,7 +455,7 @@ class OrderLogService
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function selectListByUserId($user_id, $search = "",$site_id) public function selectListByUserId($user_id, $search = "", $site_id)
{ {
$result = []; $result = [];
$sort = 0; $sort = 0;
...@@ -508,7 +508,7 @@ class OrderLogService ...@@ -508,7 +508,7 @@ class OrderLogService
$field_report = "a.id,a.create_time,a.predict_see_time,a.intro,b.id as order_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name"; $field_report = "a.id,a.create_time,a.predict_see_time,a.intro,b.id as order_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name";
$reportData = $oReportModel->selectReportByUserId($field_report, [ "user_id" => $user_id ]); $reportData = $oReportModel->selectReportByUserId($field_report, ["user_id" => $user_id]);
if (count($result) <= 0 && count($reportData) <= 0) { if (count($result) <= 0 && count($reportData) <= 0) {
return []; return [];
} }
...@@ -527,10 +527,10 @@ class OrderLogService ...@@ -527,10 +527,10 @@ class OrderLogService
} }
$order_ids = rtrim($order_ids, ","); $order_ids = rtrim($order_ids, ",");
$report_ids = rtrim($report_ids, ","); $report_ids = rtrim($report_ids, ",");
$orderParams["order_id"] = array( "in", $order_ids ); $orderParams["order_id"] = array("in", $order_ids);
$orderParams["house_title"] = array( "like", "%" . trim($search) . "%" ); $orderParams["house_title"] = array("like", "%" . trim($search) . "%");
$reportParams["report_id"] = array( "in", $report_ids ); $reportParams["report_id"] = array("in", $report_ids);
//进场 march in //进场 march in
$field_march_in = "a.id,a.reception_id,a.create_time,b.id as order_id,b.house_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name"; $field_march_in = "a.id,a.reception_id,a.create_time,b.id as order_id,b.house_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name";
...@@ -717,7 +717,7 @@ class OrderLogService ...@@ -717,7 +717,7 @@ class OrderLogService
//楼盘跟进 //楼盘跟进
$field_shop_follow_up = "a.id,a.follow_up_info,a.agent_id,a.create_time,b.name as agent_name,b.img,c.store_name"; $field_shop_follow_up = "a.id,a.follow_up_info,a.agent_id,a.create_time,b.name as agent_name,b.img,c.store_name";
$houseFollowUpData = $gHousesFollowModel->getShopFollowUpList($field_shop_follow_up, [ "house_id" => $house_id ]); $houseFollowUpData = $gHousesFollowModel->getShopFollowUpList($field_shop_follow_up, ["house_id" => $house_id]);
if (count($houseFollowUpData) > 0) { if (count($houseFollowUpData) > 0) {
foreach ($houseFollowUpData as $k => $v) { foreach ($houseFollowUpData as $k => $v) {
$v["step_name"] = "shop_follow_up"; $v["step_name"] = "shop_follow_up";
...@@ -857,8 +857,14 @@ class OrderLogService ...@@ -857,8 +857,14 @@ class OrderLogService
//todo 列表没有显示商铺地址 和产品沟通暂时搁置 //todo 列表没有显示商铺地址 和产品沟通暂时搁置
//$condition["c.house_title"] = array( 'like', "%" . trim($params['search_keyword']) . "%" ); //$condition["c.house_title"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
break; break;
case 6://客户编号
$condition["a.user_id"] = trim($params['search_keyword']);
break;
case 7://商铺编号
$condition["b.house_id"] = trim($params['search_keyword']);
break;
default: default:
return [ "code" => "101", "msg" => "搜索类型错误" ]; return ["code" => "101", "msg" => "搜索类型错误"];
} }
$vModel = new VerifyService(); $vModel = new VerifyService();
...@@ -867,7 +873,7 @@ class OrderLogService ...@@ -867,7 +873,7 @@ 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) . ") ";
} }
...@@ -1036,7 +1042,7 @@ class OrderLogService ...@@ -1036,7 +1042,7 @@ class OrderLogService
$field_commission = "a.id,a.agent_id,a.role as roles,a.scale as scales,a.scale_fee,b.role,c.name,c.phone,b.scale, $field_commission = "a.id,a.agent_id,a.role as roles,a.scale as scales,a.scale_fee,b.role,c.name,c.phone,b.scale,
b.should_commission,b.confirm_date,b.create_time,b.real_fee,b.charity_fund,b.cash,b.practical_fee,b.service_charge"; b.should_commission,b.confirm_date,b.create_time,b.real_fee,b.charity_fund,b.cash,b.practical_fee,b.service_charge";
$cent_commission_arr = $bargainModel->selectBargainCommission($field_commission, [ "bargain_id" => $bargain_id ]); $cent_commission_arr = $bargainModel->selectBargainCommission($field_commission, ["bargain_id" => $bargain_id]);
//dump($cent_commission_arr); //dump($cent_commission_arr);
$cent_commissions = []; $cent_commissions = [];
...@@ -1090,7 +1096,7 @@ class OrderLogService ...@@ -1090,7 +1096,7 @@ class OrderLogService
$result = $reportModel->selectReportById($filed, $params); $result = $reportModel->selectReportById($filed, $params);
if (count($result) > 0) { if (count($result) > 0) {
$Users = new Users(); $Users = new Users();
$Users->update_user_status([ 'id' => $result[0]["user_id"], 'user_status' => 1 ]); $Users->update_user_status(['id' => $result[0]["user_id"], 'user_status' => 1]);
} }
} }
...@@ -1185,7 +1191,7 @@ class OrderLogService ...@@ -1185,7 +1191,7 @@ class OrderLogService
$houseAgents = new GHousesToAgents(); $houseAgents = new GHousesToAgents();
$field = "b.id,b.phone,b.name"; $field = "b.id,b.phone,b.name";
$where_house["a.houses_id"] = $result[0]["house_id"]; $where_house["a.houses_id"] = $result[0]["house_id"];
$where_house["a.type"] = [ 'in', '2,3' ]; $where_house["a.type"] = ['in', '2,3'];
$where_house["a.is_del"] = 0; $where_house["a.is_del"] = 0;
$where_house["b.status"] = 0; $where_house["b.status"] = 0;
$agent_house = $houseAgents->getAgentsByHouseId($field . ',a.type', $where_house); $agent_house = $houseAgents->getAgentsByHouseId($field . ',a.type', $where_house);
...@@ -1264,7 +1270,7 @@ class OrderLogService ...@@ -1264,7 +1270,7 @@ class OrderLogService
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]);
} }
......
...@@ -106,10 +106,14 @@ class OrderModel extends Model ...@@ -106,10 +106,14 @@ class OrderModel extends Model
} }
/** /**
* @param $field * @param $field
* @param $params * @param $params
* @return false|\PDOStatement|string|\think\Collection * @param $where_
* @return mixed
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/ */
public function searchOrder($field, $params, $where_) public function searchOrder($field, $params, $where_)
{ {
......
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