Explorar el Código

Weenier 168otc项目部署 0630

wesmiler hace 3 años
padre
commit
24d4052fdd
Se han modificado 2 ficheros con 7 adiciones y 3 borrados
  1. 6 2
      app/Services/BaseService.php
  2. 1 1
      app/Services/Common/CoinLogService.php

+ 6 - 2
app/Services/BaseService.php

@@ -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);
     }
 
     /**

+ 1 - 1
app/Services/Common/CoinLogService.php

@@ -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));
         }