|
@@ -17,7 +17,7 @@ class Cyd extends Model
|
|
return $this->belongsTo('unitProduction', 'product_unit','id');
|
|
return $this->belongsTo('unitProduction', 'product_unit','id');
|
|
}
|
|
}
|
|
|
|
|
|
- function unitTest()
|
|
|
|
|
|
+ function unitTest()//受检单位
|
|
{
|
|
{
|
|
return $this->belongsTo('unitTest', 'units_id', 'id');
|
|
return $this->belongsTo('unitTest', 'units_id', 'id');
|
|
}
|
|
}
|
|
@@ -34,7 +34,7 @@ class Cyd extends Model
|
|
|
|
|
|
public function getCydListByUndertakeId($undertake_id,$pageNum,$pageSize)
|
|
public function getCydListByUndertakeId($undertake_id,$pageNum,$pageSize)
|
|
{
|
|
{
|
|
- $data = $this->with('undertake')
|
|
|
|
|
|
+ $data = $this->with(['undertake','unitTest'])
|
|
->where('undertake_id', '=', $undertake_id)
|
|
->where('undertake_id', '=', $undertake_id)
|
|
->page($pageNum,$pageSize)
|
|
->page($pageNum,$pageSize)
|
|
->select();
|
|
->select();
|
|
@@ -42,7 +42,7 @@ class Cyd extends Model
|
|
}
|
|
}
|
|
public function countCydListByUndertakeId($undertake_id)
|
|
public function countCydListByUndertakeId($undertake_id)
|
|
{
|
|
{
|
|
- $data = $this->with('undertake')
|
|
|
|
|
|
+ $data = $this->with(['undertake','unitTest'])
|
|
->where('undertake_id', '=', $undertake_id)
|
|
->where('undertake_id', '=', $undertake_id)
|
|
->count();
|
|
->count();
|
|
return $data;
|
|
return $data;
|
|
@@ -134,4 +134,10 @@ class Cyd extends Model
|
|
{
|
|
{
|
|
return $this->where('sample_id', '=', $sample_id)->find();
|
|
return $this->where('sample_id', '=', $sample_id)->find();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public function updateCydDataBySampleID($sample_id, $data)
|
|
|
|
+ {
|
|
|
|
+ return $this->where('sample_id', '=', $sample_id)->save($data);
|
|
|
|
+ }
|
|
}
|
|
}
|