|
- <?php
- //ZYB工具类
- namespace common\util;
-
- class ZybBusUtil
- {
- private static $util = null;
- private $supplierId = 1835;
-
- /**
- * Des:通用方法 只是用一些通用方法
- * Name: util
- * @return ZybBusUtil
- * @author 倪宗锋
- */
- public static function util()
- {
- if (static::$util == null) {
- static::$util = new self();
- }
- return static::$util;
- }
-
- /**
- * Des:返回信息
- * Name: returnErr
- * @param $msg
- * @param $body
- * @param $status
- * @return string
- * @author 倪宗锋
- */
- public function re($msg = '', $status = '', $body = '')
- {
- if (empty($body)) {
- $body = (object) [];
- }
- $return = [
- "describe" => $msg,
- 'order' => $body,
- 'status' => $status
- ];
- \Yii::$app->response->format = 'json';
- \Yii::$app->response->data = $return;
- return;
- }
-
- /**
- * Des:获取渠道ID
- * Name: getSupplierId
- * @return string
- * @author 倪宗锋
- */
- public function getSupplierId(){
- return $this->supplierId;
- }
- }
|