更新细节

This commit is contained in:
yaooo 2023-09-27 19:40:25 +08:00
parent 8f325973bf
commit d53a005bdd
2 changed files with 14 additions and 17 deletions

View File

@ -19,7 +19,6 @@ class JgPush
public function __construct()
{
$this->client = new Client('b5f679f4357018605ea6fd2e', 'c4fb573758f8d7058d697c54');
// $this->client = new Client('8a5efd65cda14fafa6e64ad3', 'daebe19b547c43128796a078');
$this->push = $this->client->push();
$this->setPlatform();
}
@ -43,7 +42,7 @@ class JgPush
$msg = $order['pay_type'] == StoreGroupOrder::PAY_TYPE_CREDIT_BUY ? '您有新的订单已结算,请注意查看。' : '您有新的订单,请注意查看。';
$msgType = $order['pay_type'] == StoreGroupOrder::PAY_TYPE_CREDIT_BUY ? 'ORDER_SETTLEMENT' : 'ORDER_CREATE';
$this->addRegistrationId($jgRegisterId);
// $this->androidNotification($msg, ['extras' => ['route' => $route, 'type' => $msgType]]);
$this->androidNotification($msg, ['extras' => ['route' => $route, 'type' => $msgType]]);
$this->iosNotification($msg, ['extras' => ['route' => $route, 'type' => $msgType]]);
$this->push->send();
unset($this->client, $this->push);

View File

@ -47,6 +47,7 @@ use think\facade\Db;
use think\facade\Log;
use think\facade\Queue;
use crmeb\jobs\SendSmsJob;
use app\common\service\JgPush;
use crmeb\jobs\TestJob;
use crmeb\services\PayService;
use crmeb\services\CombinePayService;
@ -64,22 +65,19 @@ class Auth extends BaseController
{
public function dotest()
{
$repository = app()->make(StoreOrderRepository::class);
$param = [
"status" => 0,
"is_del" => 0,
"mer_id" => 1,
"pay_type" => 1,
"attach" => "margin",
"order_info" => '{"is_margin":1,"margin":"0.01"}',
"pay_price" => 0.01,
"order_sn" => "bzj" . date('YmdHis') . uniqid(),
"body" =>'哈哈哈',
$data = [
"tempId" => "ADMIN_PAY_SUCCESS_CODE",
"id" => 113
];
$payType = 'weixinApp';
$service = new PayService($payType, $param);
$payInfo = $service->pay(User::where(['uid'=>1])->find());
return app('json')->success([]);
try {
/** @var JgPush $client */
$client = app()->make(JgPush::class);
Log::info('JgPush送发送数据' . json_encode($data));
$client->send($data['tempId'], $data);
} catch (\Exception $e) {
Log::info('JgPush推送消息发送失败' . json_encode($data) . ' - ' . $e->getMessage());
}
}
public function test()