优化代码格式,提升代码可读性

This commit is contained in:
mkm 2024-05-24 10:38:10 +08:00
parent 67d6fc5a3e
commit 70e58fe432
9 changed files with 201 additions and 129 deletions

View File

@ -81,7 +81,7 @@ class SupplierController extends BaseAdminController
} }
/** /**
* @notes 编辑状态 * @notes 供应商审核
* @return \think\response\Json * @return \think\response\Json
* @author likeadmin * @author likeadmin
* @date 2024/04/23 16:35 * @date 2024/04/23 16:35
@ -91,7 +91,7 @@ class SupplierController extends BaseAdminController
$params = (new SupplierValidate())->post()->goCheck('status'); $params = (new SupplierValidate())->post()->goCheck('status');
$result = SupplierLogic::status($params); $result = SupplierLogic::status($params);
if (true === $result) { if (true === $result) {
return $this->success('编辑成功', [], 1, 1); return $this->success('审核成功', [], 1, 1);
} }
return $this->fail(SupplierLogic::getError()); return $this->fail(SupplierLogic::getError());
} }

View File

@ -23,7 +23,9 @@ class FinancialRecordLists extends BaseAdminDataLists implements ListsSearchInte
*/ */
public function setSearch(): array public function setSearch(): array
{ {
return []; return [
"between_time" => 'create_time'
];
} }

View File

@ -43,6 +43,7 @@ class AdminLogic extends BaseLogic
*/ */
public static function add(array $params) public static function add(array $params)
{ {
d($params);
Db::startTrans(); Db::startTrans();
try { try {
$password = password_hash($params['password'],PASSWORD_DEFAULT); $password = password_hash($params['password'],PASSWORD_DEFAULT);

View File

@ -161,7 +161,8 @@ class MerchantLogic extends BaseLogic
$res1 = UserLogic::add($user); $res1 = UserLogic::add($user);
if ($res1 == false) { if ($res1 == false) {
Db::rollback(); Db::rollback();
throw new BusinessException(UserLogic::getError(), 0); self::setError(UserLogic::getError());
return false;
} }
$data = [ $data = [
'user_id' => $res1['id'], 'user_id' => $res1['id'],
@ -184,7 +185,13 @@ class MerchantLogic extends BaseLogic
} }
if (!empty($apply_info['jg_register_id'])) { if (!empty($apply_info['jg_register_id'])) {
(new JgPushService())->sendMsg($apply_info['jg_register_id'], '您的经销入驻请求审核' . ($params['status'] == 1 ? '通过' : '被拒绝'), '/pages/bindDistribution/index'); $res=(new JgPushService())->sendMsg($apply_info['jg_register_id'], '您的经销入驻请求审核' . ($params['status'] == 1 ? '通过' : '被拒绝'), '/pages/bindDistribution/index');
if($res!==true){
Db::rollback();
self::setError('极光推送失败:'.$res);
return false;
}
} }
Db::commit(); Db::commit();
return true; return true;

View File

@ -2,6 +2,7 @@
namespace app\admin\logic\supplier; namespace app\admin\logic\supplier;
use app\admin\logic\auth\AdminLogic;
use app\admin\logic\user\UserLogic; use app\admin\logic\user\UserLogic;
use app\common\service\JgPushService; use app\common\service\JgPushService;
use app\common\enum\OrderEnum; use app\common\enum\OrderEnum;
@ -34,19 +35,19 @@ class SupplierLogic extends BaseLogic
{ {
Db::startTrans(); Db::startTrans();
try { try {
$sys_labels=''; $sys_labels = '';
if(isset($params['sys_labels'])){ if (isset($params['sys_labels'])) {
$sys_labels=explode(',',$params['sys_labels']); $sys_labels = explode(',', $params['sys_labels']);
$sys_labels= ','.implode(',',$sys_labels).','; $sys_labels = ',' . implode(',', $sys_labels) . ',';
} }
$res= Supplier::create([ $res = Supplier::create([
'category_id' => $params['category_id'], 'category_id' => $params['category_id'],
'type_id' => $params['type_id'] ?? '', 'type_id' => $params['type_id'] ?? '',
'mer_name' => $params['mer_name'], 'mer_name' => $params['mer_name'],
'settle_cycle' => $params['settle_cycle']??15, 'settle_cycle' => $params['settle_cycle'] ?? 15,
'interest_rate' => $params['interest_rate']??0, 'interest_rate' => $params['interest_rate'] ?? 0,
'sys_labels' => $sys_labels, 'sys_labels' => $sys_labels,
'province_id' => $params['province_id'] ?? '', 'province_id' => $params['province_id'] ?? '',
'city_id' => $params['city_id'] ?? '', 'city_id' => $params['city_id'] ?? '',
'area_id' => $params['area_id'] ?? '', 'area_id' => $params['area_id'] ?? '',
'street_id' => $params['street_id'] ?? '', 'street_id' => $params['street_id'] ?? '',
@ -64,15 +65,15 @@ class SupplierLogic extends BaseLogic
'financial_wechat' => $params['financial_wechat'] ?? '', 'financial_wechat' => $params['financial_wechat'] ?? '',
'financial_alipay' => $params['financial_alipay'] ?? '', 'financial_alipay' => $params['financial_alipay'] ?? '',
'financial_type' => $params['financial_type'] ?? '', 'financial_type' => $params['financial_type'] ?? '',
'data_json'=>json_encode([ 'data_json' => json_encode([
'company_address' => $params['address'] ?? '', 'company_address' => $params['address'] ?? '',
'company_nickname' => $params['company_nickname'] ?? '', 'company_nickname' => $params['company_nickname'] ?? '',
'social_credit_code' => $params['social_credit_code'] ?? '', 'social_credit_code' => $params['social_credit_code'] ?? '',
'company_name' => $params['company_name'] ?? '', 'company_name' => $params['company_name'] ?? '',
'images'=>$params['images'][0] ?? '', 'images' => $params['images'][0] ?? '',
]) ])
]); ]);
Db::name('user_auth_shop')->insert(['pid'=>$res->id,'user_id'=>0,'shop_uid'=>$params['shop_user_id'],'status'=>0,'type'=>2,'create_time'=>time(),'jg_register_id'=>$params['jg_register_id']]); Db::name('user_auth_shop')->insert(['pid' => $res->id, 'user_id' => 0, 'shop_uid' => $params['shop_user_id'], 'status' => 0, 'type' => 2, 'create_time' => time(), 'jg_register_id' => $params['jg_register_id']]);
Db::commit(); Db::commit();
return true; return true;
} catch (\Exception $e) { } catch (\Exception $e) {
@ -90,49 +91,70 @@ class SupplierLogic extends BaseLogic
*/ */
public static function status(array $params): bool public static function status(array $params): bool
{ {
$apply_info = Db::name('user_auth_shop')->where('id',$params['apply_id'])->findOrEmpty(); $apply_info = Db::name('user_auth_shop')->where('id', $params['apply_id'])->findOrEmpty();
Db::startTrans(); Db::startTrans();
try { try {
if($params['status']==1){ if ($params['status'] == 1) {
$user=[ $user = [
'real_name'=>$params['service_phone'], 'real_name' => $params['service_phone'],
'nickname' => '用户'.$params['service_phone'], 'nickname' => '用户' . $params['service_phone'],
'account' => $params['service_phone'], 'account' => $params['service_phone'],
'mobile' => $params['service_phone'], 'mobile' => $params['service_phone'],
'password' => $params['service_phone'], 'password' => $params['service_phone'],
'sex' => 0, 'sex' => 0,
'is_disable' => 0, 'is_disable' => 0,
'user_money' => 0 'user_money' => 0
];
$res1=UserLogic::add($user);
if($res1==false){
Db::rollback();
throw new BusinessException(UserLogic::getError(), 0);
}
$data=[
'user_id'=>$res1['id'],
'status'=>1,
'apply_status'=>1,
'pid'=>$params['id']
]; ];
Supplier::where('id',$params['id'])->update(['status'=>1,'uid'=>$res1['id']]); $res1 = UserLogic::add($user);
Db::name('user_auth_shop')->where('id',$params['apply_id'])->update($data); if ($res1 == false) {
Db::rollback();
self::setError(UserLogic::getError());
return false;
}
$admin=[
'name' => '供应商' . $params['service_phone'],
'account' => $params['service_phone'],
'dept_id' => [],
'jobs_id' => [],
'role_id' => [1],
'avatar' => '',
'password' => $params['service_phone'],
'password_confirm' => $params['service_phone'],
'disable' => 0,
'multipoint_login' => 1,
'root' => 0
];
$res2 = AdminLogic::add($admin);
if ($res2 == false) {
Db::rollback();
self::setError(AdminLogic::getError());
return false;
}
$data = [
'user_id' => $res1['id'],
'status' => 1,
'apply_status' => 1,
'pid' => $params['id']
];
Supplier::where('id', $params['id'])->update(['status' => 1, 'uid' => $res1['id']]);
Db::name('user_auth_shop')->where('id', $params['apply_id'])->update($data);
} }
if($params['status']==0){ if ($params['status'] == 0) {
$data=[ $data = [
'mark'=>$params['mark']??'', 'mark' => $params['mark'] ?? '',
'apply_status'=>-1 'apply_status' => -1
]; ];
Supplier::where('id', $params['id'])->update([ Supplier::where('id', $params['id'])->update([
'status' => 0, 'status' => 0,
]); ]);
Db::name('user_auth_shop')->where('id',$params['apply_id'])->update($data); Db::name('user_auth_shop')->where('id', $params['apply_id'])->update($data);
} }
if(!empty($apply_info['jg_register_id'])){ if (!empty($apply_info['jg_register_id'])) {
(new JgPushService()) -> sendMsg($apply_info['jg_register_id'],'您的供应入驻请求审核'.($params['status']==1?'通过':'被拒绝'),'/pages/bindSupplier/index'); (new JgPushService())->sendMsg($apply_info['jg_register_id'], '您的供应入驻请求审核' . ($params['status'] == 1 ? '通过' : '被拒绝'), '/pages/bindSupplier/index');
} }
Db::commit(); Db::commit();
return true; return true;
} catch (\Exception $e) { } catch (\Exception $e) {
@ -153,43 +175,43 @@ class SupplierLogic extends BaseLogic
{ {
Db::startTrans(); Db::startTrans();
try { try {
$sys_labels=''; $sys_labels = '';
if(isset($params['sys_labels'])){ if (isset($params['sys_labels'])) {
$sys_labels=explode(',',$params['sys_labels']); $sys_labels = explode(',', $params['sys_labels']);
$sys_labels= ','.implode(',',$sys_labels).','; $sys_labels = ',' . implode(',', $sys_labels) . ',';
} }
Supplier::where('id', $params['id'])->update([ Supplier::where('id', $params['id'])->update([
'category_id' => $params['category_id']??'', 'category_id' => $params['category_id'] ?? '',
'type_id' => $params['type_id'] ?? '', 'type_id' => $params['type_id'] ?? '',
'mer_name' => $params['mer_name'], 'mer_name' => $params['mer_name'],
'settle_cycle' => $params['settle_cycle'] ?? 15, 'settle_cycle' => $params['settle_cycle'] ?? 15,
'interest_rate' => $params['interest_rate'] ?? 0, 'interest_rate' => $params['interest_rate'] ?? 0,
'sys_labels' => $sys_labels, 'sys_labels' => $sys_labels,
'province_id' => $params['province_id'] ?? '', 'province_id' => $params['province_id'] ?? '',
'city_id' => $params['city_id'] ?? '', 'city_id' => $params['city_id'] ?? '',
'area_id' => $params['area_id'] ?? '', 'area_id' => $params['area_id'] ?? '',
'street_id' => $params['street_id'] ?? '', 'street_id' => $params['street_id'] ?? '',
'village_id' => $params['village_id'] ?? '', 'village_id' => $params['village_id'] ?? '',
'mer_address' => $params['mer_address'] ?? '', 'mer_address' => $params['mer_address'] ?? '',
'mer_avatar' => $params['mer_avatar'] ?? '', 'mer_avatar' => $params['mer_avatar'] ?? '',
'mark' => $params['mark'] ?? '', 'mark' => $params['mark'] ?? '',
'status' => $params['status'] ?? 0, 'status' => $params['status'] ?? 0,
'commission_rate' => $params['commission_rate'] ?? '', 'commission_rate' => $params['commission_rate'] ?? '',
'commission_switch' => $params['commission_switch'] ?? '', 'commission_switch' => $params['commission_switch'] ?? '',
'long' => $params['long'] ?? '', 'long' => $params['long'] ?? '',
'lat' => $params['lat'] ?? '', 'lat' => $params['lat'] ?? '',
'service_phone' => $params['phone'], 'service_phone' => $params['phone'],
'financial_bank' => $params['financial_bank'] ?? '', 'financial_bank' => $params['financial_bank'] ?? '',
'financial_wechat' => $params['financial_wechat'] ?? '', 'financial_wechat' => $params['financial_wechat'] ?? '',
'financial_alipay' => $params['financial_alipay'] ?? '', 'financial_alipay' => $params['financial_alipay'] ?? '',
'financial_type' => $params['financial_type'] ?? '', 'financial_type' => $params['financial_type'] ?? '',
'data_json'=>json_encode([ 'data_json' => json_encode([
'company_address' => $params['address'] ?? '', 'company_address' => $params['address'] ?? '',
'company_nickname' => $params['company_nickname'] ?? '', 'company_nickname' => $params['company_nickname'] ?? '',
'social_credit_code' => $params['social_credit_code'] ?? '', 'social_credit_code' => $params['social_credit_code'] ?? '',
'company_name' => $params['company_name'] ?? '', 'company_name' => $params['company_name'] ?? '',
'images'=>$params['images'][0] ?? '', 'images' => $params['images'][0] ?? '',
]) ])
]); ]);
Db::commit(); Db::commit();
@ -204,15 +226,16 @@ class SupplierLogic extends BaseLogic
/** /**
* @notes 设置余额 * @notes 设置余额
*/ */
public static function set_money($id,$set_money,$type=1){ public static function set_money($id, $set_money, $type = 1)
{
Db::startTrans(); Db::startTrans();
try { try {
if($type==1){ if ($type == 1) {
Supplier::where('id',$id)->inc('mer_money',$set_money)->update(); Supplier::where('id', $id)->inc('mer_money', $set_money)->update();
$record = [ $record = [
'financial_record_sn' => time(), 'financial_record_sn' => time(),
'order_id' => 0, 'order_id' => 0,
'number_sn' =>getNewOrderId('XTCZ') , 'number_sn' => getNewOrderId('XTCZ'),
'user_id' => 0, 'user_id' => 0,
'financial_type' => OrderEnum::SYSTEM_SET, 'financial_type' => OrderEnum::SYSTEM_SET,
'financial_pm' => OrderEnum::INCOME, 'financial_pm' => OrderEnum::INCOME,
@ -222,18 +245,18 @@ class SupplierLogic extends BaseLogic
'mer_id' => $id, 'mer_id' => $id,
]; ];
FinancialRecord::create($record); FinancialRecord::create($record);
}else{ } else {
$money=Supplier::where('id',$id)->value('mer_money'); $money = Supplier::where('id', $id)->value('mer_money');
if($money<$set_money){ if ($money < $set_money) {
Db::rollback(); Db::rollback();
self::setError('余额不足'); self::setError('余额不足');
return false; return false;
} }
Supplier::where('id',$id)->dec('mer_money',$set_money)->update(); Supplier::where('id', $id)->dec('mer_money', $set_money)->update();
$record = [ $record = [
'financial_record_sn' => time(), 'financial_record_sn' => time(),
'order_id' => 0, 'order_id' => 0,
'number_sn' =>getNewOrderId('XTJS') , 'number_sn' => getNewOrderId('XTJS'),
'user_id' => 0, 'user_id' => 0,
'financial_type' => OrderEnum::SYSTEM_SET, 'financial_type' => OrderEnum::SYSTEM_SET,
'financial_pm' => OrderEnum::EXPENDITURE, 'financial_pm' => OrderEnum::EXPENDITURE,
@ -275,31 +298,31 @@ class SupplierLogic extends BaseLogic
*/ */
public static function detail($params): array public static function detail($params): array
{ {
$data = Supplier::findOrEmpty($params['id']); $data = Supplier::findOrEmpty($params['id']);
$province = Db::name('geo_province')->field('province_name')->where('province_code',$data['province_id'])->findOrEmpty(); $province = Db::name('geo_province')->field('province_name')->where('province_code', $data['province_id'])->findOrEmpty();
$city = Db::name('geo_city')->field('city_name')->where('city_code',$data['city_id'])->findOrEmpty(); $city = Db::name('geo_city')->field('city_name')->where('city_code', $data['city_id'])->findOrEmpty();
$area = Db::name('geo_area')->field('area_name')->where('area_code',$data['area_id'])->findOrEmpty(); $area = Db::name('geo_area')->field('area_name')->where('area_code', $data['area_id'])->findOrEmpty();
$street = Db::name('geo_street')->field('street_name')->where('street_code',$data['street_id'])->findOrEmpty(); $street = Db::name('geo_street')->field('street_name')->where('street_code', $data['street_id'])->findOrEmpty();
$village = Db::name('geo_village')->field('village_name')->where('village_code',$data['village_id'])->findOrEmpty(); $village = Db::name('geo_village')->field('village_name')->where('village_code', $data['village_id'])->findOrEmpty();
$data['province_name'] = !empty($province) ? $province['province_name'] : ''; $data['province_name'] = !empty($province) ? $province['province_name'] : '';
$data['city_name'] = !empty($city) ? $city['city_name'] : ''; $data['city_name'] = !empty($city) ? $city['city_name'] : '';
$data['area_name'] = !empty($area) ? $area['area_name'] : ''; $data['area_name'] = !empty($area) ? $area['area_name'] : '';
$data['street_name'] = !empty($street) ? $street['street_name'] : ''; $data['street_name'] = !empty($street) ? $street['street_name'] : '';
$data['village_name'] = !empty($village) ? $village['village_name'] : ''; $data['village_name'] = !empty($village) ? $village['village_name'] : '';
if(!empty($data['sys_labels'])){ if (!empty($data['sys_labels'])) {
$goodslabel = GoodsLabel::where('id','in',$data['sys_labels'])->column('name'); $goodslabel = GoodsLabel::where('id', 'in', $data['sys_labels'])->column('name');
$data['sys_labels_text'] = implode(',',$goodslabel); $data['sys_labels_text'] = implode(',', $goodslabel);
}else{ } else {
$data['sys_labels_text'] = ''; $data['sys_labels_text'] = '';
} }
$data['supplier_banks'] = MerchantBank::where('supplier_id',$params['id'])->select()->each(function($item){ $data['supplier_banks'] = MerchantBank::where('supplier_id', $params['id'])->select()->each(function ($item) {
$item['is_check_text'] = $item->is_check_text; $item['is_check_text'] = $item->is_check_text;
$item['is_own_text'] = $item->is_own_text; $item['is_own_text'] = $item->is_own_text;
})->toArray(); })->toArray();
return $data->toArray(); return $data->toArray();
} }
/** /**
* @notes 设置标签 * @notes 设置标签
* @param $params * @param $params
* @return bool * @return bool
@ -310,9 +333,9 @@ class SupplierLogic extends BaseLogic
try { try {
$value = $params['sys_labels']; $value = $params['sys_labels'];
if (!empty($value)) { if (!empty($value)) {
if (!is_array($value)){ if (!is_array($value)) {
$value= ',' . $value . ','; $value = ',' . $value . ',';
}else{ } else {
$value = ',' . implode(',', $value) . ','; $value = ',' . implode(',', $value) . ',';
} }
} }

View File

@ -2,7 +2,6 @@
namespace app\api\controller\financial; namespace app\api\controller\financial;
use app\api\controller\BaseApiController; use app\api\controller\BaseApiController;
use app\api\lists\financial\FinancialRecordLists; use app\api\lists\financial\FinancialRecordLists;
@ -46,4 +45,16 @@ class FinancialRecordController extends BaseApiController
} }
return $this->dataLists((new FinancialRecordLists)); return $this->dataLists((new FinancialRecordLists));
} }
/**
* @notes 获取商户流水统计
* @return \think\response\Json
* @author likeadmin
* @date 2024/04/23 10:27
*/
public function api_lists()
{
$this->request->__set('is_detail',1);
return $this->dataLists((new FinancialRecordLists));
}
} }

View File

@ -7,6 +7,7 @@ use app\admin\lists\BaseAdminDataLists;
use app\common\enum\OrderEnum; use app\common\enum\OrderEnum;
use app\common\lists\ListsSearchInterface; use app\common\lists\ListsSearchInterface;
use app\common\model\financial\FinancialRecord; use app\common\model\financial\FinancialRecord;
use app\common\model\user\User;
/** /**
* 商户财务记录列表 * 商户财务记录列表
@ -53,8 +54,24 @@ class FinancialRecordLists extends BaseAdminDataLists implements ListsSearchInte
]; ];
$this->where = $where; $this->where = $where;
$searchWhere=$this->searchWhere; $searchWhere=$this->searchWhere;
$list = FinancialRecord::where($this->searchWhere) $is_detail=$this->request->__get('is_detail');
if($is_detail==1){
$list = FinancialRecord::where($this->searchWhere)
->where($where) ->where($where)
->limit($this->limitOffset, $this->limitLength)
->order('create_time','desc')
->select()->each(function ($item) {
$item['user_nickname']='';
if($item['user_id']!=0){
$item['user_nickname']=User::where('id',$item['user_id'])->value('nickname');
}
$item['financial_pm']=$item['financial_pm']==0?"支出":"获得";
return $item;
});
}else{
$list = FinancialRecord::where($this->searchWhere)
->where($where)
->limit($this->limitOffset, $this->limitLength)
->field("FROM_UNIXTIME(create_time, '%Y-%m-%d') as record_date, SUM(number) as total_amount") ->field("FROM_UNIXTIME(create_time, '%Y-%m-%d') as record_date, SUM(number) as total_amount")
->group('record_date') ->group('record_date')
->order('record_date') ->order('record_date')
@ -63,7 +80,12 @@ class FinancialRecordLists extends BaseAdminDataLists implements ListsSearchInte
$item['cashier_total_amount'] = $cashier_total_amount; $item['cashier_total_amount'] = $cashier_total_amount;
$cashier_cash_total_amount=FinancialRecord::where($where)->where($searchWhere)->where('financial_type',OrderEnum::CASHIER_CASH_ORDER_PAY)->sum('number'); $cashier_cash_total_amount=FinancialRecord::where($where)->where($searchWhere)->where('financial_type',OrderEnum::CASHIER_CASH_ORDER_PAY)->sum('number');
$item['cashier_cash_total_amount'] = $cashier_cash_total_amount; $item['cashier_cash_total_amount'] = $cashier_cash_total_amount;
$platofrm_total_amount=FinancialRecord::where($where)->where($searchWhere)->where('financial_type',OrderEnum::USER_ORDER_PAY)->sum('number');
$item['platofrm_total_amount'] = $platofrm_total_amount;
}); });
}
return $list?->toArray(); return $list?->toArray();
} }

View File

@ -66,10 +66,12 @@ class OrderEnum
self::USER_ORDER_PAY=>'用户订单支付', self::USER_ORDER_PAY=>'用户订单支付',
self::MERCHANT_ORDER_PAY=>'商户订单支付', self::MERCHANT_ORDER_PAY=>'商户订单支付',
self::PLATFORM_ORDER_PAY=>'平台订单支付', self::PLATFORM_ORDER_PAY=>'平台订单支付',
self::MERCHANT_ORDER_OBTAINS=>'商户订单提现', self::MERCHANT_ORDER_OBTAINS=>'商户订单获得',
self::ORDER_HANDLING_FEES=>'订单手续费', self::ORDER_HANDLING_FEES=>'订单手续费',
self::PLATFORM_ORDER_OBTAINS=>'平台订单获得', self::PLATFORM_ORDER_OBTAINS=>'平台订单获得',
self::SUPPLIER_ORDER_OBTAINS=>'供应商订单获得', self::SUPPLIER_ORDER_OBTAINS=>'供应商订单获得',
self::SYSTEM_SET=>'平台设置',
]; ];
if ($value === true) { if ($value === true) {

View File

@ -4,6 +4,7 @@
use JPush\Client; use JPush\Client;
use support\Log; use support\Log;
use support\exception\BusinessException;
class JgPushService class JgPushService
@ -34,9 +35,10 @@
$this->push->iosNotification($message, ['extras' => ['route' => $route, 'type' => $type]]); $this->push->iosNotification($message, ['extras' => ['route' => $route, 'type' => $type]]);
$this->push->send(); $this->push->send();
unset($this->client, $this->push); unset($this->client, $this->push);
return true;
} catch (\Exception $e) { } catch (\Exception $e) {
dump($e->getMessage());
Log::error($e->getMessage()); Log::error($e->getMessage());
return $e->getMessage();
} }
try { try {
$this->client = new Client($this->azKey, $this->azSecret); $this->client = new Client($this->azKey, $this->azSecret);
@ -46,9 +48,11 @@
$this->push->androidNotification($message, ['extras' => ['route' => $route, 'type' => $type]]); $this->push->androidNotification($message, ['extras' => ['route' => $route, 'type' => $type]]);
$this->push->send(); $this->push->send();
unset($this->client, $this->push); unset($this->client, $this->push);
return true;
} catch (\Exception $e) { } catch (\Exception $e) {
dump($e->getMessage());
Log::error($e->getMessage()); Log::error($e->getMessage());
return $e->getMessage();
} }
} }
} }