Commit 83d65abd authored by hujun's avatar hujun

用户注册并发处理

parent 921e3cee
......@@ -480,4 +480,30 @@ class Users extends Model
public function updateUserAll($data) {
return $this->saveAll($data);
}
/**
* 跟进用户手机号查询信息
*
* @param string $field
* @param $phone
* @param bool $lock
* @return $this|array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function findUserByPhone($field = '*', $phone, $lock = false) {
if ($lock) {
$data = $this->field($field)
->where('user_phone',$phone)
->lock(true)
->find();
} else {
$data = $this->field($field)
->where('user_phone',$phone)
->find();
}
return $data;
}
}
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