|
|
@@ -94,11 +94,13 @@ class CardService extends BaseService
|
|
|
*/
|
|
|
public function edit()
|
|
|
{
|
|
|
+ $this->model::where(['mark'=> 2])->where('update_time','<=', time() - 3600)->delete();
|
|
|
+
|
|
|
$data = request()->all();
|
|
|
$userId = isset($data['user_id'])? $data['user_id'] : 0;
|
|
|
$id = isset($data['id'])? $data['id'] : 0;
|
|
|
if($userId && $id<=0){
|
|
|
- $info = $this->model::where(['user_id'=> $userId])->first();
|
|
|
+ $info = $this->model::where(['user_id'=> $userId,'mark'=> 1])->first();
|
|
|
if($info){
|
|
|
return message('每个用户暂时只能创建一张卡', false);
|
|
|
}
|