123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace Jobs\Controller;
- use Mall\Framework\Factory;
- class BaseController
- {
- /** @var \Mall\Framework\Core\Request $request */
- protected $request;
- /** @var \Mall\Framework\Core\Cache $cache */
- protected $cache;
- public function __construct($isCheckAcl = true)
- {
- $this->request = Factory::request();
- //$this->cache = Factory::cache();
- }
- public function sendOutput($data, $errorcode = 0)
- {
- $errorcode = intval($errorcode);
- if ($errorcode) {
- $sendMessage = [
- 'state' => false,
- 'data' => $data,
- 'errorcode' => $errorcode
- ];
- } else {
- $sendMessage = [
- 'state' => true,
- 'data' => $data,
- 'errorcode' => $errorcode
- ];
- }
- exit(json_encode($sendMessage, JSON_UNESCAPED_UNICODE));
- }
- }
|