@@ -268,9 +268,13 @@ class BaseService
* @param string $pk 键名
* @return mixed
*/
- public function checkExists($field, $value, $pk='id')
+ public function checkExists($field, $value, $pk='id',$status=1)
{
- return $this->model->where([$field=> $value,'status'=>1,'mark'=>1])->value($pk);
+ $where = [$field=> $value,'status'=>$status,'mark'=>1];
+ if($status>0){
+ $where['status'] = $status;
+ }
+ return $this->model->where($where)->value($pk);
}
/**
@@ -116,7 +116,7 @@ class CoinLogService extends BaseService
return $result;
- $result = parent::checkExists($field, $value, $pk);
+ $result = parent::checkExists($field, $value, $pk, 0);
if($result){
RedisService::set($cacheKey, $result, rand(3,5));