|
@@ -108,6 +108,21 @@ class AssetService extends Service
|
|
return $data;
|
|
return $data;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function assetDetail($data){
|
|
|
|
+ if(empty($data['singleCode'])) return [false, '资产唯一编码不能为空'];
|
|
|
|
+
|
|
|
|
+ $return = [];
|
|
|
|
+ $asset = Asset::where('del_time',0)->where('singleCode', $data['singleCode'])->first();
|
|
|
|
+ if(! empty($asset)) {
|
|
|
|
+ $return = $asset->toArray();
|
|
|
|
+ }else{
|
|
|
|
+ $asset = AssetOther::where('del_time',0)->where('singleCode', $data['singleCode'])->first();
|
|
|
|
+ if(! empty($asset)) $return = $asset->toArray();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return [true, 'asset' => $return];
|
|
|
|
+ }
|
|
|
|
+
|
|
public function AssetRule($data, $is_check = true){
|
|
public function AssetRule($data, $is_check = true){
|
|
if($this->isEmpty($data,'name')) return [false,'资产名称不能为空!'];
|
|
if($this->isEmpty($data,'name')) return [false,'资产名称不能为空!'];
|
|
if($this->isEmpty($data,'singleCode')) return [false,'资产唯一码不能为空!'];
|
|
if($this->isEmpty($data,'singleCode')) return [false,'资产唯一码不能为空!'];
|