shopxo/app/service/ApiService.php

46 lines
1.4 KiB
PHP

<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://opensource.org/licenses/mit-license.php )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\service;
/**
* api服务层
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-06-22
* @desc description
*/
class ApiService
{
/**
* api数据统一返回
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-07-20
* @desc description
* @param [array] $data [api统一返回]
*/
public static function ApiDataReturn($data)
{
// api统一返回钩子
$hook_name = 'plugins_service_api_data_return';
MyEventTrigger($hook_name,
[
'hook_name' => $hook_name,
'is_backend' => true,
'data' => &$data,
]);
return json($data);
}
}
?>