修改代码注释

This commit is contained in:
邹景立 2021-09-13 14:15:29 +08:00
parent 35cf9b7747
commit 265d8a5838
9 changed files with 18 additions and 32 deletions

View File

@ -4,7 +4,6 @@ namespace app\data\controller\api;
use app\data\service\UserAdminService; use app\data\service\UserAdminService;
use app\data\service\UserTokenService; use app\data\service\UserTokenService;
use Exception;
use think\admin\Controller; use think\admin\Controller;
use think\exception\HttpResponseException; use think\exception\HttpResponseException;
@ -79,7 +78,7 @@ abstract class Auth extends Controller
return UserAdminService::instance()->get($this->uuid, $this->type); return UserAdminService::instance()->get($this->uuid, $this->type);
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->error($exception->getMessage()); $this->error($exception->getMessage());
} }
} }

View File

@ -3,7 +3,6 @@
namespace app\data\controller\api; namespace app\data\controller\api;
use app\data\service\UserAdminService; use app\data\service\UserAdminService;
use Exception;
use think\admin\Controller; use think\admin\Controller;
use think\exception\HttpResponseException; use think\exception\HttpResponseException;
use think\Response; use think\Response;
@ -99,7 +98,7 @@ class Wxapp extends Controller
} }
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->error("数据处理失败,{$exception->getMessage()}"); $this->error("数据处理失败,{$exception->getMessage()}");
} }
} }
@ -128,7 +127,7 @@ class Wxapp extends Controller
} }
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->error("授权换取失败,{$exception->getMessage()}"); $this->error("授权换取失败,{$exception->getMessage()}");
} }
} }
@ -154,7 +153,7 @@ class Wxapp extends Controller
} }
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->error($exception->getMessage()); $this->error($exception->getMessage());
} }
} }
@ -170,7 +169,7 @@ class Wxapp extends Controller
$this->success('获取直播列表成功!', $list); $this->success('获取直播列表成功!', $list);
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->error($exception->getMessage()); $this->error($exception->getMessage());
} }
} }
@ -191,7 +190,7 @@ class Wxapp extends Controller
$this->success('获取回放视频成功!', $result); $this->success('获取回放视频成功!', $result);
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->error($exception->getMessage()); $this->error($exception->getMessage());
} }
} }

View File

@ -6,7 +6,6 @@ use app\data\controller\api\Auth;
use app\data\service\RebateService; use app\data\service\RebateService;
use app\data\service\UserAdminService; use app\data\service\UserAdminService;
use app\data\service\UserUpgradeService; use app\data\service\UserUpgradeService;
use Exception;
use think\admin\Storage; use think\admin\Storage;
use think\exception\HttpResponseException; use think\exception\HttpResponseException;
@ -71,7 +70,7 @@ class Center extends Auth
} }
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->error($exception->getMessage()); $this->error($exception->getMessage());
} }
} }

View File

@ -11,8 +11,6 @@ use app\data\service\GoodsService;
use app\data\service\OrderService; use app\data\service\OrderService;
use app\data\service\PaymentService; use app\data\service\PaymentService;
use app\data\service\UserAdminService; use app\data\service\UserAdminService;
use Exception;
use stdClass;
use think\admin\extend\CodeExtend; use think\admin\extend\CodeExtend;
use think\exception\HttpResponseException; use think\exception\HttpResponseException;
@ -186,7 +184,7 @@ class Order extends Auth
$this->success('商品下单成功', $order); $this->success('商品下单成功', $order);
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->error("商品下单失败,{$exception->getMessage()}"); $this->error("商品下单失败,{$exception->getMessage()}");
} }
} }
@ -347,10 +345,10 @@ class Order extends Auth
// 返回订单数据及支付发起参数 // 返回订单数据及支付发起参数
$type = $order['amount_real'] <= 0 ? 'empty' : $data['payment_code']; $type = $order['amount_real'] <= 0 ? 'empty' : $data['payment_code'];
$param = PaymentService::instance($type)->create($openid, $order['order_no'], $order['amount_real'], '商城订单支付', '', $data['payment_back'], $data['payment_image']); $param = PaymentService::instance($type)->create($openid, $order['order_no'], $order['amount_real'], '商城订单支付', '', $data['payment_back'], $data['payment_image']);
$this->success('获取支付参数', ['order' => ShopOrder::mk()->where($map)->find() ?: new stdClass(), 'param' => $param]); $this->success('获取支付参数', ['order' => ShopOrder::mk()->where($map)->find() ?: new \stdClass(), 'param' => $param]);
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->error($exception->getMessage()); $this->error($exception->getMessage());
} }
} }
@ -475,7 +473,7 @@ class Order extends Auth
empty($result['code']) ? $this->error($result['info']) : $this->success('快递追踪信息', $result); empty($result['code']) ? $this->error($result['info']) : $this->success('快递追踪信息', $result);
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->error($exception->getMessage()); $this->error($exception->getMessage());
} }
} }

View File

@ -4,9 +4,6 @@ namespace app\data\controller\api\auth;
use app\data\controller\api\Auth; use app\data\controller\api\Auth;
use app\data\service\RebateService; use app\data\service\RebateService;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
/** /**
* 用户返利管理 * 用户返利管理
@ -17,9 +14,9 @@ class Rebate extends Auth
{ {
/** /**
* 获取用户返利记录 * 获取用户返利记录
* @throws DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws DbException * @throws \think\db\exception\DbException
* @throws ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
*/ */
public function get() public function get()
{ {

View File

@ -3,7 +3,6 @@
namespace app\data\controller\base\postage; namespace app\data\controller\base\postage;
use app\data\service\ExpressService; use app\data\service\ExpressService;
use Exception;
use think\admin\Controller; use think\admin\Controller;
use think\exception\HttpResponseException; use think\exception\HttpResponseException;
@ -106,7 +105,7 @@ class Company extends Controller
$this->success('同步快递公司成功!'); $this->success('同步快递公司成功!');
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->error('同步快递公司数据失败!'); $this->error('同步快递公司数据失败!');
} }
} }

View File

@ -5,7 +5,6 @@ namespace app\data\controller\shop;
use app\data\service\OrderService; use app\data\service\OrderService;
use app\data\service\PaymentService; use app\data\service\PaymentService;
use app\data\service\UserAdminService; use app\data\service\UserAdminService;
use Exception;
use think\admin\Controller; use think\admin\Controller;
use think\admin\extend\CodeExtend; use think\admin\extend\CodeExtend;
use think\exception\HttpResponseException; use think\exception\HttpResponseException;
@ -179,7 +178,7 @@ class Order extends Controller
} }
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->error($exception->getMessage()); $this->error($exception->getMessage());
} }
} }

View File

@ -4,7 +4,6 @@ namespace app\data\controller\shop;
use app\data\service\ExpressService; use app\data\service\ExpressService;
use app\data\service\OrderService; use app\data\service\OrderService;
use Exception;
use think\admin\Controller; use think\admin\Controller;
use think\exception\HttpResponseException; use think\exception\HttpResponseException;
@ -155,7 +154,7 @@ class Send extends Controller
$this->fetch('truck_query'); $this->fetch('truck_query');
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->error($exception->getMessage()); $this->error($exception->getMessage());
} }
} }

View File

@ -6,7 +6,6 @@ use app\data\model\DataUser;
use app\data\model\DataUserBalance; use app\data\model\DataUserBalance;
use app\data\model\ShopOrder; use app\data\model\ShopOrder;
use app\data\model\ShopOrderItem; use app\data\model\ShopOrderItem;
use Exception;
use think\admin\Service; use think\admin\Service;
/** /**
@ -50,8 +49,6 @@ class UserUpgradeService extends Service
$agent = DataUser::mk()->where(['id' => $pid0])->find(); $agent = DataUser::mk()->where(['id' => $pid0])->find();
if (empty($agent['vip_code'])) return [0, '代理无推荐资格']; if (empty($agent['vip_code'])) return [0, '代理无推荐资格'];
if (stripos($agent['path'], "-{$uuid}-") !== false) return [0, '不能绑定下属']; if (stripos($agent['path'], "-{$uuid}-") !== false) return [0, '不能绑定下属'];
// 组装代理数据
try { try {
$this->app->db->transaction(function () use ($user, $agent, $mode) { $this->app->db->transaction(function () use ($user, $agent, $mode) {
// 更新用户代理 // 更新用户代理
@ -73,7 +70,7 @@ class UserUpgradeService extends Service
}); });
$this->upgrade($user['id']); $this->upgrade($user['id']);
return [1, '绑定代理成功']; return [1, '绑定代理成功'];
} catch (Exception $exception) { } catch (\Exception $exception) {
return [0, "绑定代理失败, {$exception->getMessage()}"]; return [0, "绑定代理失败, {$exception->getMessage()}"];
} }
} }