inital commit
This commit is contained in:
39
app/Models/UserIdentityQuestionAnswer.php
Normal file
39
app/Models/UserIdentityQuestionAnswer.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class UserIdentityQuestionAnswer extends BaseModel
|
||||
{
|
||||
use HasFactory;
|
||||
protected $fillable=['question', 'answer' ,'user_id'];
|
||||
|
||||
public function insertData($inputData){
|
||||
|
||||
$result = [];
|
||||
$insertData = [];
|
||||
|
||||
if(!empty($inputData)){
|
||||
foreach ($inputData['data'] as $data){
|
||||
$insertData[] = [
|
||||
'user_id' => $inputData['user_id'],
|
||||
'question' => $data['question'],
|
||||
'answer' => $data['answer']['name'],
|
||||
'created_at' => $this->getSystemCurrentTimeStamp(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($insertData)) {
|
||||
$result = self::insert($insertData);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
public function getUserIdentityQuestionAnswer($user_id)
|
||||
{
|
||||
$questionAnswer=[];
|
||||
$questionAnswer = self::where('user_id',$user_id)->get();
|
||||
return $questionAnswer;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user