فهرست منبع

feature/EK-3320

ryan 1 ماه پیش
والد
کامیت
ff8adb8e8b

+ 2 - 0
backendApi/config/params.php

@@ -25,6 +25,7 @@ return [
         'v1/calc/auto-calc',
         'v1/shop/order-period-adjust-batch',
         'v1/shop/order-invoice-remark',
+        'v1/shop/order-invoice-method',
         'v1/shop/order-invoice-export',
 //        'v1/site/countries'
     ],
@@ -94,6 +95,7 @@ return [
         'calc/auto-calc',
         'shop/order-period-adjust-batch',
         'shop/order-invoice-remark',
+        'shop/order-invoice-method',
         'shop/order-invoice-export',
     ],
 ];

+ 1 - 0
backendApi/config/urlManagerRules.php

@@ -56,6 +56,7 @@ return [
             'GET dec-order-list-export' => 'dec-order-list-export',
             'POST delete-order' => 'delete-order',
             'GET order-list' => 'order-list',
+            'GET order-invoice-method' => 'order-invoice-method',
             'POST order-invoice-remark' => 'order-invoice-remark',
             'GET order-invoice-export/<orderSn>' => 'order-invoice-export',
             'GET order-list-export' => 'order-list-export',

+ 10 - 0
backendApi/modules/v1/controllers/ShopController.php

@@ -469,6 +469,16 @@ class ShopController extends BaseController {
         }
     }
 
+    /**
+     * 订单发票支付方式
+     * @return mixed
+     * @throws Exception
+     * @throws HttpException
+     */
+    public function actionOrderInvoiceMethod() {
+        return static::notice(['method'=>['Cash', 'Credit Card', 'Direct Banking', 'Cheque']]);
+    }
+
     /**
      * 订单表
      * @return mixed

+ 4 - 1
common/models/forms/OrderInvoiceRemarkForm.php

@@ -9,6 +9,7 @@ class OrderInvoiceRemarkForm extends Model
 {
     public $orderSn;
     public $invoiceRemark;
+    public $orderMethod;
 
     /**
      * @inheritdoc
@@ -19,6 +20,8 @@ class OrderInvoiceRemarkForm extends Model
             [['orderSn'], 'trim'],
             [['orderSn'], 'required'],
             ['invoiceRemark', 'string', 'max' => 50000],
+            ['orderMethod', 'string'],
+            ['orderMethod', 'in', 'range' => ['Cash', 'Credit Card', 'Direct Banking', 'Cheque']],
         ];
     }
 
@@ -63,7 +66,7 @@ class OrderInvoiceRemarkForm extends Model
         $transaction = $db->beginTransaction();
         try {
             Order::updateAll(
-                ['INVOICE_REMARK' => $this->invoiceRemark],
+                ['INVOICE_REMARK' => $this->invoiceRemark,'METHOD'=>$this->orderMethod],
                 'SN=:SN',
                 ['SN' => $sn]
             );