| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- namespace hd\controllers;
- use bizHd\order\classes\OrderClass;
- use common\components\util;
- use Yii;
- class TestController extends BaseController
- {
- public function actionTestPayAfter()
- {
- // $get = Yii::$app->request->get();
- // $id = $get['order_id'];
- // $order = OrderClass::getById($id, true);
- // if (empty($order)) {
- // util::fail('没有找到订单');
- // }
- // if ($order->mainId != $this->mainId) {
- // util::fail('不是你的订单');
- // }
- //
- // $payWay = 1; // balancePay
- // $connection = Yii::$app->db;
- // $transaction = $connection->beginTransaction();
- // try {
- // $actPrice = $order->actPrice;
- // $order->debtPrice = $actPrice;
- // $order->remainDebtPrice = $actPrice;
- // $order->debt = 1;
- // $order->save();
- // OrderClass::payAfter($order, $payWay);
- // $transaction->commit();
- // util::complete('付款成功');
- // } catch (\Exception $exception) {
- // $transaction->rollBack();
- // Yii::info("付款失败原因:" . $exception->getMessage());
- // util::fail('操作失败');
- // }
- }
- public function actionPush()
- {
- $push = new \common\components\push('hd', \common\components\push::MSG_TYPE_ORDER);
- $cids = [
- '030e02ba8fe602f3c6222b1f360aa88f', // 华为
- '4570ecb8970811d07629742c1612f3cd', // OPPO
- 'acec28309378a16c4ed10bbea6d40635', // 小米
- 'ee1763340e6e8778b9d6af259e65511f', // 荣耀 -- ee1763340e6e8778b9d6af259e65511f
- 'b768e3af3991d00f27d3ee728401b769', // Apple XS - 我的(线下)
- 'c9f4ccdf5b75da87abe1e9bcef6ef33f', // Apple XS Max - 测试机
- ];
- $title = '新订单';
- $content = '您有新的订单,请查看 order_id: ' . random_int(100000, 999999);
- $payload = [
- "page" => "pagesClient/member/detail",
- "params" => ["id" => 682]
- ];
- $rs = $push->pushByCloud($cids, $title, $content, $payload);
- Yii::info(json_encode($rs));
- // clientId 后接状态:successed_online / successed_offline
- echo json_encode($rs);
- }
- }
|