| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <?php
- namespace addons\WechatVideoShop\common\logic\traits;
- use addons\WechatVideoShop\common\service\OrderCallbackService;
- trait WeChatCallbackOrderTrait
- {
- /**
- * {
- * "ToUserName": "gh_*",
- * "FromUserName": "OPENID",
- * "CreateTime": 1662480000,
- * "MsgType": "event",
- * "Event": "channels_ec_order_new",
- * "order_info": {
- * "order_id": 3705115058471208928
- * }
- * }
- * 订单下单
- * @return void
- * @throws \Exception
- */
- public function channels_ec_order_new(array $params)
- {
- $this->init($params);
- (new OrderCallbackService($this->shop_id, $this->mall_id, $this->customer_num))->create($this->data);
- }
- /**
- * {
- * "ToUserName": "gh_*",
- * "FromUserName": "OPENID",
- * "CreateTime": 1662480000,
- * "MsgType": "event",
- * "Event": "channels_ec_order_cancel",
- * "order_info": {
- * "order_id": 3705115058471208928,
- * "cancel_type": 1
- * }
- * }
- * 订单取消
- * @return void
- * @throws \Exception
- */
- public function channels_ec_order_cancel(array $params)
- {
- $this->init($params);
- (new OrderCallbackService($this->shop_id, $this->mall_id))->cancel($this->data);
- }
- /**
- * {
- * "ToUserName": "gh_*",
- * "FromUserName": "OPENID",
- * "CreateTime": 1662480000,
- * "MsgType": "event",
- * "Event": "channels_ec_order_pay",
- * "order_info": {
- * "order_id": 3705115058471208928,
- * "pay_time": 1658509200
- * }
- * }
- * 订单支付
- * @return void
- * @throws \Exception
- */
- public function channels_ec_order_pay(array $params)
- {
- $this->init($params);
- (new OrderCallbackService($this->shop_id, $this->mall_id))->paid($this->data);
- }
- /**
- * {
- * "ToUserName": "gh_*",
- * "FromUserName": "OPENID",
- * "CreateTime": 1662480000,
- * "MsgType": "event",
- * "Event": "channels_ec_order_deliver",
- * "order_info": {
- * "order_id": 3705115058471208928,
- * "finish_delivery": 1
- * }
- * }
- * 订单发货
- * @return void
- * @throws \Exception
- */
- public function channels_ec_order_deliver(array $params)
- {
- $this->init($params);
- (new OrderCallbackService($this->shop_id, $this->mall_id))->ship($this->data);
- }
- /**
- * {
- * "ToUserName": "gh_*",
- * "FromUserName": "OPENID",
- * "CreateTime": 1662480000,
- * "MsgType": "event",
- * "Event": "channels_ec_order_confirm",
- * "order_info": {
- * "order_id": 3705115058471208928,
- * "confirm_type": 1
- * }
- * }
- * 订单收货
- * @return void
- * @throws \Exception
- */
- public function channels_ec_order_confirm(array $params)
- {
- $this->init($params);
- (new OrderCallbackService($this->shop_id, $this->mall_id))->sing($this->data);
- }
- /**
- * {
- * "ToUserName": "gh_*",
- * "FromUserName": "OPENID",
- * "CreateTime": 1662480000,
- * "MsgType": "event",
- * "Event": "channels_ec_order_settle",
- * "order_info": {
- * "order_id": 3705115058471208928,
- * "settle_time": 1662480000
- * }
- * }
- * 订单结算
- * @return void
- * @throws \Exception
- */
- public function channels_ec_order_settle(array $params)
- {
- $this->init($params);
- (new OrderCallbackService($this->shop_id, $this->mall_id))->settlement($this->data);
- }
- /**
- * {
- * "ToUserName": "gh_*",
- * "FromUserName": "OPENID",
- * "CreateTime": 1662480000,
- * "MsgType": "event",
- * "Event": "channels_ec_order_ext_info_update",
- * "order_info": {
- * "order_id": 3705115058471208928,
- * "type": 1
- * }
- * }
- * 订单其他信息更新
- * @return void
- * @throws \Exception
- */
- public function channels_ec_order_ext_info_update(array $params)
- {
- $this->init($params);
- (new OrderCallbackService($this->shop_id, $this->mall_id))->update($this->data);
- }
- /**
- * @return void
- * @throws \Exception
- */
- public function product_order_status_update(array $params)
- {
- $this->init($params);
- // $key = 'ProductOrderStatusUpdate';
- // switch ($this->data[$key]['status']) {
- // case 10: // 待付款
- // (new OrderCallbackService($this->shop_id, $this->mall_id))->create($this->data, $key);
- // break;
- // case 20: // 已支付
- // (new OrderCallbackService($this->shop_id, $this->mall_id))->paid($this->data, $key);
- // break;
- // case 21: // 部分发货
- // break;
- // case 30: // 待收货
- // (new OrderCallbackService($this->shop_id, $this->mall_id))->ship($this->data, $key);
- // break;
- // case 100: // 订单完成
- // (new OrderCallbackService($this->shop_id, $this->mall_id))->sing($this->data, $key);
- // break;
- // case 200: // 全部商品售后之后,订单取消
- // (new OrderCallbackService($this->shop_id, $this->mall_id))->cancel($this->data, $key);
- // break;
- // case 250: // 未付款用户主动取消或超时未付款订单自动取消
- // (new OrderCallbackService($this->shop_id, $this->mall_id))->cancel($this->data, $key);
- // break;
- // }
- }
- }
|