Commit 44d864bd authored by zw's avatar zw

bug

parent c49ca904
......@@ -18,6 +18,7 @@ use app\model\OReportModel;
use app\model\OTaxes;
use app\model\Regions;
use app\model\UPhoneFollowUp;
use app\model\UPhoneFollowUpTemporary;
use app\model\Users;
......@@ -752,11 +753,27 @@ class OrderLogService
$oBargainModel = new OBargainModel();
$uPhoneFollowModel = new UPhoneFollowUp($site_id);
$uPhoneFollowTempModel = new UPhoneFollowUpTemporary($site_id);
//电话跟进
$userParams["user_id"] = $user_id;
$userParams["type"] = 0; //电话跟进
$field_user_follow = "a.id,a.content,a.user_id,a.agent_id,a.type,a.create_time,a.user_status,b.name,b.phone,b.img,c.store_name";
$bargainData = $uPhoneFollowModel->getFollowUpListByUserId($field_user_follow, $userParams);
$bargainDataTemp = $uPhoneFollowTempModel->getFollowUpListByUserId($field_user_follow, $userParams);
if (count($bargainDataTemp) > 0) {
foreach ($bargainDataTemp as $k => $v) {
$type = "无效";
if ($v["user_status"] == 0) {
$type = "求租";
} elseif ($v["user_status"] == 1) {
$type = "已租";
}
$v["step_name"] = "phone_follow_up";
$v["step"] = "电话跟进:" . $v['content'] . "【" . $type . "】";
$result[$sort++] = $v;
}
}
if (count($bargainData) > 0) {
foreach ($bargainData as $k => $v) {
$type = "无效";
......@@ -774,6 +791,21 @@ class OrderLogService
//跟进
$userParams["type"] = 1; //普通跟进
$bargainData = $uPhoneFollowModel->getFollowUpListByUserId($field_user_follow, $userParams);
$bargainDataTemp = $uPhoneFollowTempModel->getFollowUpListByUserId($field_user_follow, $userParams);
if (count($bargainDataTemp) > 0) {
foreach ($bargainDataTemp as $k => $v) {
$type = "无效";
if ($v["user_status"] == 0) {
$type = "求租";
} elseif ($v["user_status"] == 1) {
$type = "已租";
}
$v["step_name"] = "follow_up";
$v["step"] = "跟进:" . $v['content'] . "【" . $type . "】";
$result[$sort++] = $v;
}
}
if (count($bargainData) > 0) {
foreach ($bargainData as $k => $v) {
$type = "无效";
......
......@@ -133,6 +133,29 @@ class UPhoneFollowUpTemporary extends BaseModel
return $result;
}
public function getFollowUpListByUserId($field, $params)
{
if(!$this->createTable()){
return null;
}
$where_ = [];
if (isset($params["user_id"])) {
$where_["a.user_id"] = $params["user_id"];
}
if (isset($params["type"])) {
$where_["a.type"] = $params["type"];
}
$result = $this->follow_up
->field($field)
->alias("a")
->join("a_agents b", "a.agent_id = b.id", "left")
->join("a_store c", "b.store_id = c.id", "left")
->where($where_)
->select();
return $result;
}
/**
......
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