Commit def43306 authored by zhuwei's avatar zhuwei

查询客户是否在保护期内

parent 6b1437e2
......@@ -4,6 +4,7 @@ namespace app\index\controller;
use app\index\extend\Basic;
use app\index\service\ImageDepotService;
use app\index\service\UserService;
use app\model\GImageDepot;
/**
......@@ -170,16 +171,10 @@ class ImageDepot extends Basic
public function ceshi(){
$a = 1;
dump($a);
dump('============');
if($a == 2){
}
dump('============');
dump($a);
$user_service = new UserService();
$res = $user_service->isUserProtect(1);
dump($res);
}
......
......@@ -314,7 +314,23 @@ class UserService
$push->record(2, 0, [0=>$old_agent_id], $operation_id, $data);
}
//todo 查询客户是否在保护期内
/**
* 查询客户是否在保护期内
* @param $user_id
* @return bool
*/
public function isUserProtect($user_id){
if(!$user_id){
return false;
}
$res = $this->user->selectUser($user_id, "id,protect_time");
if ((time() < strtotime($res['protect_time']))) {
return true;//保护期内
}else{
return false;//过保护期
}
}
/**
* 设置或者更新客户保护期
......
......@@ -942,7 +942,7 @@ class Users extends Model
$result = Db::table($this->table)
->where('id', $id)
->update($params);
//dump($this->getLastSql());
//echo $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