Commit d1a07866 authored by zw's avatar zw

报备增加搜索条件

parent 83527f24
......@@ -453,7 +453,7 @@ class OrderLog extends Basic
{
$params = $this->params;
/* $params = array(
"type" => 1, //0.客户电话 1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址
"type" => 1, //0.客户电话 1.客户姓名,去掉 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址 6客户编号 7商铺编号
"agent_id" => 4022,
"search_keyword" => "程"
);*/
......
......@@ -61,7 +61,7 @@ class OrderLogService
* @throws \think\exception\DbException
*/
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 = [];
$father_id = 0;
......@@ -69,11 +69,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);
$house_number, $industry_type, $remark, $transfer_img, $source, $income_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));
$house_number, $industry_type, $remark, $transfer_img, $source, $income_time));
}
}
}
......@@ -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,
$industry_type, $remark, $transfer_img, $source,$income_time)
$industry_type, $remark, $transfer_img, $source, $income_time)
{
$arr["report_id"] = $report_id;
......@@ -158,7 +158,7 @@ class OrderLogService
$arr["transfer_img"] = $transfer_img;
$arr["create_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);
}
......@@ -204,7 +204,7 @@ class OrderLogService
$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) { //修改楼盘
$houseNumUpdateService = new HouseNumUpdateService();
......@@ -291,19 +291,19 @@ class OrderLogService
$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);
if (count($orderData) <= 0) {
return [ "101", "找不到此订单编号" ];
return ["101", "找不到此订单编号"];
}
$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,
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) {
return [ "101", "报备记录未找到" ];
return ["101", "报备记录未找到"];
}
//报备
$reportData[0]["step_name"] = "report";
......@@ -313,7 +313,7 @@ class OrderLogService
//进场 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";
$marchInData = $oMarchInModel->selectMarchInByOrderNo($field_march_in, [ "order_id" => $order_id ]);
$marchInData = $oMarchInModel->selectMarchInByOrderNo($field_march_in, ["order_id" => $order_id]);
if (count($marchInData) > 0) {
foreach ($marchInData as $k => $v) {
$v["step_name"] = "march_in";
......@@ -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,
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) {
foreach ($followUpLogData as $k => $v) {
......@@ -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,
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) {
$sortPayLogData = $this->arr2tree($payLogData);
foreach ($sortPayLogData as $k => $v) {
......@@ -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,
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) {
foreach ($refundData as $k => $v) {
$v["step_name"] = "refund";
......@@ -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,
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) {
$bargain_data_arr = $this->arr2TreeBargain($bargainData);
foreach ($bargain_data_arr as $k2 => $v2) {
......@@ -455,7 +455,7 @@ class OrderLogService
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectListByUserId($user_id, $search = "",$site_id)
public function selectListByUserId($user_id, $search = "", $site_id)
{
$result = [];
$sort = 0;
......@@ -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";
$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) {
return [];
}
......@@ -527,10 +527,10 @@ class OrderLogService
}
$order_ids = rtrim($order_ids, ",");
$report_ids = rtrim($report_ids, ",");
$orderParams["order_id"] = array( "in", $order_ids );
$orderParams["house_title"] = array( "like", "%" . trim($search) . "%" );
$orderParams["order_id"] = array("in", $order_ids);
$orderParams["house_title"] = array("like", "%" . trim($search) . "%");
$reportParams["report_id"] = array( "in", $report_ids );
$reportParams["report_id"] = array("in", $report_ids);
//进场 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";
......@@ -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";
$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) {
foreach ($houseFollowUpData as $k => $v) {
$v["step_name"] = "shop_follow_up";
......@@ -857,8 +857,14 @@ class OrderLogService
//todo 列表没有显示商铺地址 和产品沟通暂时搁置
//$condition["c.house_title"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
break;
case 6://客户编号
$condition["a.user_id"] = trim($params['search_keyword']);
break;
case 7://商铺编号
$condition["b.house_id"] = trim($params['search_keyword']);
break;
default:
return [ "code" => "101", "msg" => "搜索类型错误" ];
return ["code" => "101", "msg" => "搜索类型错误"];
}
$vModel = new VerifyService();
......@@ -867,7 +873,7 @@ class OrderLogService
$where_ = $condition;
if ($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) . ") ";
}
......@@ -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,
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);
$cent_commissions = [];
......@@ -1090,7 +1096,7 @@ class OrderLogService
$result = $reportModel->selectReportById($filed, $params);
if (count($result) > 0) {
$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
$houseAgents = new GHousesToAgents();
$field = "b.id,b.phone,b.name";
$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["b.status"] = 0;
$agent_house = $houseAgents->getAgentsByHouseId($field . ',a.type', $where_house);
......@@ -1264,7 +1270,7 @@ class OrderLogService
public function getBillInfo($order_id)
{
$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
}
/**
* @param $field
* @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_)
{
......
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