diff --git a/extend/catcher/Code.php b/extend/catcher/Code.php index d570a39..cd4a241 100644 --- a/extend/catcher/Code.php +++ b/extend/catcher/Code.php @@ -11,4 +11,6 @@ class Code public const FAILED = 10005; // 操作失败 public const LOGIN_EXPIRED = 10006; // 登录失效 public const LOGIN_BLACKLIST = 10007; // 黑名单 + + public const WECHAT_RESPONSE_ERROR = 40000; } diff --git a/extend/catcher/base/CatchRepository.php b/extend/catcher/base/CatchRepository.php index 3200e5d..37c1800 100644 --- a/extend/catcher/base/CatchRepository.php +++ b/extend/catcher/base/CatchRepository.php @@ -7,4 +7,41 @@ * @author JaguarJack * @copyright By CatchAdmin * @license https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt - */ \ No newline at end of file + */ +namespace catcher\base; + + +/** + * @method getList(array $data = []) + * @method store(array $data) + * @method updateBy(int $id, array $data) + * @method findBy(int $id, array $column = ['*']) + * @method deleteBy(int $id) + * @method beginTransaction() + * @method rollback() + * @method commit() + * @method transaction(\Closure $callback) + * @method raw($sql) + */ +abstract class CatchRepository +{ + /** + * 模型映射方法 + * + * @time 2019年05月26日 + * @email wuyanwen@baijiayun.com + * @param $name + * @param $arguments + * @return mixed + * @throws \Exception + */ + public function __call($name, $arguments) + { + // TODO: Implement __call() method. + if (method_exists($this, 'model')) { + return call_user_func_array([$this->model(), $name], $arguments);//$this->model()->$name(...$arguments); + } + + throw new \Exception(sprintf('Method %s Not Found~', $name)); + } +} \ No newline at end of file