|
@@ -2230,11 +2230,18 @@ class ButtService extends ZskkDefaultService {
|
|
|
{
|
|
{
|
|
|
$this->butt->insertDmLog(['data'=>json_encode($data),'type'=>1]);
|
|
$this->butt->insertDmLog(['data'=>json_encode($data),'type'=>1]);
|
|
|
$arr = $this->makeDmExamDatas($data);
|
|
$arr = $this->makeDmExamDatas($data);
|
|
|
- $where = ['studyuid'=>$arr['studyuid'],'institution_id'=>$arr['institution_id']];
|
|
|
|
|
- $exam = $this->butt->getExam($where,'*');
|
|
|
|
|
|
|
+ $exam = [];
|
|
|
|
|
+ if(!empty($arr['studyuid']))
|
|
|
|
|
+ {
|
|
|
|
|
+ $where = ['studyuid'=>$arr['studyuid'],'institution_id'=>$arr['institution_id']];
|
|
|
|
|
+ $exam = $this->butt->getExam($where,'*');
|
|
|
|
|
+ }
|
|
|
if(empty($exam))
|
|
if(empty($exam))
|
|
|
{
|
|
{
|
|
|
- $info = $this->butt->getExam(['imagenumber'=>$arr['imagenumber'],'institution_id'=>$arr['institution_id']],'*');
|
|
|
|
|
|
|
+ if(!empty($arr['imagenumber']))
|
|
|
|
|
+ {
|
|
|
|
|
+ $info = $this->butt->getExam(['imagenumber'=>$arr['imagenumber'],'institution_id'=>$arr['institution_id']],'*');
|
|
|
|
|
+ }
|
|
|
if(empty($info))
|
|
if(empty($info))
|
|
|
{
|
|
{
|
|
|
$arr['id'] = UUIDUtils::uuid();
|
|
$arr['id'] = UUIDUtils::uuid();
|
|
@@ -2291,8 +2298,12 @@ class ButtService extends ZskkDefaultService {
|
|
|
public function saveDmReport($data)
|
|
public function saveDmReport($data)
|
|
|
{
|
|
{
|
|
|
$this->butt->insertDmLog(['data'=>json_encode($data),'type'=>2]);
|
|
$this->butt->insertDmLog(['data'=>json_encode($data),'type'=>2]);
|
|
|
- $where = ['imagenumber'=>$data['B']['BD'],'institution_id'=>$data['B']['BJ']];
|
|
|
|
|
- $exam = $this->butt->getExam($where,'*');
|
|
|
|
|
|
|
+ $exam = [];
|
|
|
|
|
+ if(!empty($data['B']['BD']))
|
|
|
|
|
+ {
|
|
|
|
|
+ $where = ['imagenumber'=>$data['B']['BD'],'institution_id'=>$data['B']['BJ']];
|
|
|
|
|
+ $exam = $this->butt->getExam($where,'*');
|
|
|
|
|
+ }
|
|
|
$report = $this->makeReportData($data);
|
|
$report = $this->makeReportData($data);
|
|
|
if(empty($exam))
|
|
if(empty($exam))
|
|
|
{
|
|
{
|