where($id,$data[$id])->count()) { $data['updated_at'] = date('Y-m-d H:i:s'); $state = $this->where($id,$data[$id])->strict(false)->update($data); } else { $data['created_at'] = date('Y-m-d H:i:s'); $state = $this->strict(false)->insertGetId($data); } } catch (\Throwable $throwable) { return false; } return $state; } public function getPk() { return $this->primaryKey; } }