Commit 6b1437e2 authored by zhuwei's avatar zhuwei

设置或者更新客户保护期

parent 224aa4f5
......@@ -313,4 +313,25 @@ class UserService
$data['user_id'] = $user_id;
$push->record(2, 0, [0=>$old_agent_id], $operation_id, $data);
}
//todo 查询客户是否在保护期内
/**
* 设置或者更新客户保护期
* @return mixed
*/
public function setUserProtectTime($user_id){
if(!$user_id){
return false;
}
$future_time = date("Y-m-d H:i:s",strtotime("+1 day"));//24小时前的时间
$params_['protect_time'] = $future_time;
$res = $this->user->updateUsers($user_id,$params_);//int(1)
if($res == 1){
return true;
}else{
return false;
}
}
}
\ No newline at end of file
......@@ -933,5 +933,17 @@ class Users extends Model
->group("b.id")
->count();
}
/**
* 更新数据
*/
public function updateUsers($id,$params)
{
$result = Db::table($this->table)
->where('id', $id)
->update($params);
//dump($this->getLastSql());
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