Commit e9f7a294 authored by clone's avatar clone

bug

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