| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?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 = [
- '', // OPPO
- '', // 小米 - 线上
- '', //
- '', // 华为
- '', // VIVO
- '', // VIVO 线上
- '', // 荣耀
- '', // Apple XS - 我的(线下)
- '', // 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);
- }
- }
|