travel/service/app/controller/base.php

13 lines
353 B
PHP
Raw Permalink Normal View History

2024-06-24 11:52:30 +08:00
<?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 );
}
}