Files
2024-05-26 16:00:30 +08:00

51 lines
1.2 KiB
PHP

<?php
/**
* 线索池
*/
class Clues_entity
{
private $ci;
public function __construct()
{
$this->ci = &get_instance();
}
//添加日志
public function add_log($clue_id, $uid, $uname, $log, $type = '')
{
$this->ci->load->model('receiver/receiver_clue_oplogs_model', 'oplogs_model');
$data = [
'clue_id' => $clue_id,
'uid' => $uid,
'uname' => $uname,
'log' => $log,
'c_time' => time()
];
$type && $data['type'] = $type;
$r_id = $this->ci->oplogs_model->add($data);
return $r_id;
}
/**
* 获取cfrom标题
* @param $cf_id int 来源id
* return string
*/
public function cf_title($cf_id)
{
$this->ci->load->model('receiver/receiver_clues_cfrom_model', 'cfrom_model');
$row = $this->ci->cfrom_model->get(['id' => $cf_id], 'id,pid,title');
$cf_title = $row['title'];
if ($row['pid']) {
$pid_row = $this->ci->cfrom_model->get(['id' => $row['pid']], 'id,pid,title');
$cf_title = $pid_row['title'] . '-' . $cf_title;
}
return $cf_title;
}
}
?>