Commit e9f7a294 authored by clone's avatar clone

bug

parent 46877159
......@@ -127,7 +127,7 @@ class User extends Basic
$clientService = new ClientService();
$list = [];
foreach ($userList as $k => $v) {
$is_show = $clientService->dialTotal($v["user_id"]);
$is_show = $clientService->dialTotal($v["user_phone"]);
if ($is_show) {
array_push($list, $v);
}
......
......@@ -3,6 +3,7 @@
namespace app\api_broker\service;
use app\extra\RedisExt;
use app\model\BindingPhone;
use app\model\UPhoneFollowPp;
/**
......@@ -14,16 +15,16 @@ use app\model\UPhoneFollowPp;
*/
class ClientService
{
private $uPhoneFollowUpModel;
private $bindingPhoneModel;
private $redis;
public function __construct()
{
$this->uPhoneFollowUpModel = new UPhoneFollowPp();
$this->redis = RedisExt::getRedis();
$this->bindingPhoneModel = new BindingPhone();
$this->redis = RedisExt::getRedis();
}
public function dialTotal($user_id)
public function dialTotal($user_phone)
{
$day = 1;
$num = 5;
......@@ -31,13 +32,13 @@ class ClientService
$day = $this->redis->get("s_agent_call_day");
$num = $this->redis->get("s_agent_call_number");
}
$start_time = date("Y-m-d H:i:s", strtotime("-$day day"));
$end_time = date("Y-m-d H:i:s", time());
$params["create_time"] = array( "between", array( $start_time, $end_time ) );
$params["user_id"] = $user_id;
$params["phone_b"] = $user_phone;
$total = $this->uPhoneFollowUpModel->getCount( $params);
$total = $this->bindingPhoneModel->getCount($params);
if ($total > $num) {
return false;
} else {
......
......@@ -179,4 +179,12 @@ class BindingPhone extends BaseModel
$insert_data['status'] = $status;
return $this->insert($insert_data);
}
public function getCount( $where)
{
$r = $this
->where($where)
->count();
return $r;
}
}
\ No newline at end of file
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