13 lines
353 B
PHP
13 lines
353 B
PHP
<?php
|
|
namespace app\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 );
|
|
}
|
|
} |