|
@@ -178,6 +178,17 @@ class Api
|
|
|
}
|
|
|
$this->result($msg, $data, $code, $type, $header);
|
|
|
}
|
|
|
+ //find查询出来的结果如果为空数组,强制转换object
|
|
|
+ protected function success_find($msg = '', $data = null, $code = 1, $type = null, array $header = [])
|
|
|
+ {
|
|
|
+ if(empty($msg)){
|
|
|
+ $msg = '操作成功';
|
|
|
+ }
|
|
|
+ if(is_null($data) || $data === []){
|
|
|
+ $data = (object)[];
|
|
|
+ }
|
|
|
+ $this->result($msg, $data, $code, $type, $header);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 操作失败返回的数据
|