suiteId = $component['suite_id']; $this->appTemplateId = $component['app_template_id']; $this->corpid = $component['corpid']; $this->suiteSecret = $component['suite_secret']; $this->appTemplateSecret = $component['app_template_secret']; } use AuthorizesRequests, DispatchesJobs, ValidatesRequests; public static function returnValue($data = [], $errorNo = 0, $errorSuffix = '') { return [ "rst" => $data, "errno" => $errorNo . '', "err" => empty($errorSuffix) ? Error::getError($errorNo) : $errorSuffix, "timestamp" => intval(microtime(true)) . '', // 客户端代码版本号,用于客户端自动加载新提交的代码 'v' => (string) get_client_code_version(), "auno" => '0' ]; } /** * 统一分页响应格式 * @param $data * @param $total * @param $pageSize * @param int $page * @param null $extra * @return array */ public static function returnPageValue($data, $total, $pageSize, $page, $extra = null) { $pages = $pageSize > 0 ? ceil($total / $pageSize) : 0; $result = [ 'data' => $data, 'pageInfo' => [ 'total' => $total, 'pages' => $pages, 'size' => $pageSize, 'page' => $page ] ]; if( $extra !== null){ $result['extra'] = $extra; } return self::returnValue($result); } }