| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace ghs\controllers;
- use bizGhs\custom\classes\CustomClass;
- use bizGhs\express\classes\ExpressClass;
- use bizGhs\order\classes\OrderClass;
- use common\components\util;
- use Yii;
- //用于物流服务
- class ExpressController extends BaseController
- {
- //新建运单 ssh
- public function actionAddNewWayBill()
- {
- $get = Yii::$app->request->get();
- $id = $get['id'] ?? 0;
- $order = OrderClass::getById($id, true);
- if (empty($order)) {
- util::fail('没有找到订单');
- }
- if ($order->mainId != $this->mainId) {
- util::fail('不是你的订单');
- }
- $customId = $order->customId ?? 0;
- $custom = CustomClass::getById($customId, true);
- if (empty($custom)) {
- util::fail('没有找到客户');
- }
- //要先去后台绑定,这里填写才有用,mainId对应月结账号
- $bizIdMap = [
- //长春花路鲜花,
- '36707' => '4212960899',
- //龙岩花掌柜
- '50' => '5925274162',
- ];
- $mainId = $this->mainId;
- $bizId = $bizIdMap[$mainId] ?? 0;
- if (empty($bizId)) {
- util::fail('没有找到月结账号');
- }
- $params = [
- 'bizId' => $bizId,
- ];
- ExpressClass::addWayBill($params);
- }
- }
|