13 lines
357 B
PHP
13 lines
357 B
PHP
<?php
|
|
namespace app\api\controller;
|
|
|
|
class base
|
|
{
|
|
public function success($data,$mess = null, $ext = null) {
|
|
return json(['error' => 0, 'msg' => $mess ?? 'ok','data' => $data, 'ext' => $ext]);
|
|
}
|
|
|
|
public function error($code, $mess = null) {
|
|
return json(['error' => $code, 'msg' => $mess ?? 'error'], JSON_NUMERIC_CHECK );
|
|
}
|
|
} |