Commit 0e5511bc authored by clone's avatar clone

1

parent 4fb75a66
......@@ -83,6 +83,11 @@ class OfficeOrderLogService
$father_id = 0;
$money = 0;
$type = 0;
//获取门店id
$redis_service = new RedisCacheService();
$agent_data = $redis_service->getRedisCache(2, $agent_id);
$store_id = $agent_data['store_id'];
foreach ($collecting_bill as $collecting) {
if (isset($collecting["type"]) && isset($collecting["pay_type"]) && isset($collecting["money"])) {
if (!$this->verifyType($collecting["type"], $collecting["pay_type"], $receipt_number)) {
......@@ -100,13 +105,13 @@ class OfficeOrderLogService
$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, $receipt_number, $transfer_name, $received_money, $type_ext,
$bargain_id, $is_open);
$bargain_id, $is_open, $store_id);
$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, $receipt_number, $transfer_name, $received_money,
$type_ext, $bargain_id, $is_open));
$type_ext, $bargain_id, $is_open, $store_id));
}
//$this->updateBargainIsOpen($bargain_id, $collecting['type'], $is_open);
}
......@@ -280,32 +285,33 @@ class OfficeOrderLogService
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, $receipt_number, $transfer_name,
$received_money, $type_ext, $bargain_id, $is_open)
$received_money, $type_ext, $bargain_id, $is_open, $store_id)
{
$arr["report_id"] = $report_id;
$arr["father_id"] = $father_id;
$arr["order_no"] = $order_no;
$arr["order_id"] = $order_id;
$arr["source"] = $source;
$arr["agent_id"] = $agent_id;
$arr["agent_name"] = $agent_name;
$arr["type"] = $collecting_arr["type"];
$arr["pay_type"] = $collecting_arr["pay_type"];
$arr["money"] = $collecting_arr["money"];
$arr["house_number"] = $house_number;
$arr["industry_type"] = $industry_type;
$arr["remark"] = $remark;
$arr["receipt_number"] = $receipt_number;
$arr["transfer_name"] = $transfer_name;
$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());
$arr["is_dividend"] = $is_dividend;
$arr["received_money"] = $received_money;
$arr["type_ext"] = $type_ext;
$arr["bargain_id"] = $bargain_id;
$arr["is_open"] = $is_open;
$arr["report_id"] = $report_id;
$arr["father_id"] = $father_id;
$arr["order_no"] = $order_no;
$arr["order_id"] = $order_id;
$arr["reckon_in_store"] = $store_id;
$arr["source"] = $source;
$arr["agent_id"] = $agent_id;
$arr["agent_name"] = $agent_name;
$arr["type"] = $collecting_arr["type"];
$arr["pay_type"] = $collecting_arr["pay_type"];
$arr["money"] = $collecting_arr["money"];
$arr["house_number"] = $house_number;
$arr["industry_type"] = $industry_type;
$arr["remark"] = $remark;
$arr["receipt_number"] = $receipt_number;
$arr["transfer_name"] = $transfer_name;
$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());
$arr["is_dividend"] = $is_dividend;
$arr["received_money"] = $received_money;
$arr["type_ext"] = $type_ext;
$arr["bargain_id"] = $bargain_id;
$arr["is_open"] = $is_open;
if ($income_time) {
$arr["income_time"] = date("Y-m-d H:i:s", $income_time);
}
......@@ -1435,7 +1441,7 @@ class OfficeOrderLogService
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function searchBargainAgents($type, $order_id,$site_id)
public function searchBargainAgents($type, $order_id, $site_id)
{
$orderModel = new OfficeOrderModel();
$field = "a.id,a.order_no,a.house_id,a.house_title,b.id as report_id,b.user_id,c.user_nick,c.user_phone,
......@@ -1457,12 +1463,12 @@ class OfficeOrderLogService
$list = $houseAgents->getAgentsByHouseId($fields, $params);
break;
case 2:
$fields = "c.id,c.phone,c.name";
$userModel = new Users();
$params["a.id"] = $result[0]["user_id"];
$params["c.status"] = 0;
$fields = "c.id,c.phone,c.name";
$userModel = new Users();
$params["a.id"] = $result[0]["user_id"];
$params["c.status"] = 0;
$params["b.site_id"] = $site_id;
$list = $userModel->getAgentBySiteId($fields, $params);
$list = $userModel->getAgentBySiteId($fields, $params);
break;
case 3: //反签 == 报备人
$reportModel = new OfficeOReportModel();
......@@ -1510,7 +1516,7 @@ class OfficeOrderLogService
public function searchBargainAllAgents($order_id)
{
$orderModel = new OfficeOrderModel();
$fields = "a.id,a.order_no,a.house_id,a.house_title,b.id as report_id,b.user_id,c.user_nick,c.user_phone,
$fields = "a.id,a.order_no,a.house_id,a.house_title,b.id as report_id,b.user_id,c.user_nick,c.user_phone,
c.user_pic,c.sex";
$where_["order_id"] = $order_id;
$result = $orderModel->selectOrderDetail($fields, $where_);
......@@ -1520,12 +1526,12 @@ class OfficeOrderLogService
}
$houseAgents = new OfficeGRoomToAgent();
$field = "b.id,b.phone,b.name";
$field = "b.id,b.phone,b.name";
$where_house["a.house_id"] = $result[0]["house_id"];
$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);
$agent_house = $houseAgents->getAgentsByHouseId($field . ',a.type', $where_house);
$list = [];
$key = 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