| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace addons\Happiness\common\service;
- use Exception;
- class BaseService
- {
- public $mall_id;
- public $user_id;
- public $store_id;
- public $platform;
- public $user;
- public $admin;
- public function __construct($config = [])
- {
- $this->mall_id = $config['mall_id'] ?? 0;
- $this->user_id = $config['user_id'] ?? 0;
- $this->platform = $config['platform'] ?? '';
- $this->store_id = $config['store_id'] ?? 0;
- $this->user = $config['user'] ?? [];
- $this->admin = $config['admin'] ?? [];
- }
- /**
- * 错误信息
- *
- * @var string
- */
- protected $error;
- /**
- * 错误返回
- *
- * @param string $msg
- * @return false
- */
- public function error(string $msg = '')
- {
- $this->error = $msg;
- return false;
- }
- /**
- * 获取错误信息
- *
- * @return string
- */
- public function getError()
- {
- return $this->error;
- }
- }
|