|
...
|
...
|
@@ -83,12 +83,19 @@ class TemplateLogic extends BaseLogic |
|
|
|
*/
|
|
|
|
public function first($source,$source_id)
|
|
|
|
{
|
|
|
|
return $data = BTemplate::where([
|
|
|
|
$data = BTemplate::where([
|
|
|
|
'project_id'=>$this->user['project_id'],
|
|
|
|
'data_source' => $source,
|
|
|
|
'data_source_id' => $source_id,
|
|
|
|
'template_id' => BSetting::_get($this->user['project_id'])['template_id']
|
|
|
|
])->first();
|
|
|
|
if(empty($data)){
|
|
|
|
$data = ATemplate::where([
|
|
|
|
'project_id'=>$this->user['project_id'],
|
|
|
|
'template_id' => BSetting::_get($this->user['project_id'])['template_id']
|
|
|
|
])->first();
|
|
|
|
}
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
...
|
...
|
|