travel/service/app/api/controller/base.php

13 lines
357 B
PHP
Raw Normal View History

2024-10-21 17:14:32 +08:00
<?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 );
}
}