Преглед изворни кода

发票后台搜索以及编辑时候的字段不一致

evoxwht пре 2 година
родитељ
комит
dccfdfbe5e

+ 2 - 0
crmeb/app/adminapi/controller/v1/order/StoreOrderInvoice.php

@@ -45,6 +45,8 @@ class StoreOrderInvoice extends AuthController
     {
         $where = $this->request->getMore([
             ['data', '', '', 'time'],
+            ['real_name', ''],
+            ['field_key', ''],
             [['type', 'd'], 0],
         ]);
         $data = $this->services->chart($where);

+ 12 - 5
crmeb/app/services/order/StoreOrderInvoiceServices.php

@@ -36,21 +36,28 @@ class StoreOrderInvoiceServices extends BaseServices
 
     public function chart(array $where)
     {
+        $where['is_pay'] = 1;
         //全部
-        $data['all'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time']]);
+        $data['all'] = (string)$this->dao->count($where);
         //待开
-        $data['noOpened'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 1]);
+        $where['type'] = 1;
+        $data['noOpened'] = (string)$this->dao->count($where);
         //已开
-        $data['opened'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 2]);
+        $where['type'] = 2;
+        $data['opened'] = (string)$this->dao->count($where);
         //退款
-        $data['refund'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 3]);
+        $where['type'] = 3;
+        $data['refund'] = (string)$this->dao->count($where);
         return $data;
     }
 
     /**
      * 后台获取开票列表
-     * @param $where
+     * @param array $where
      * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getList(array $where)
     {

+ 3 - 2
template/admin/src/pages/order/invoice/index.vue

@@ -151,7 +151,7 @@
           <div class="list">
             <div class="title row">联系信息</div>
             <Row class="row">
-              <Col span="12">真实姓名: {{ invoiceDetails.real_name }}</Col>
+              <Col span="12">真实姓名: {{ invoiceDetails.name }}</Col>
               <Col span="12">联系电话: {{ invoiceDetails.user_phone }}</Col>
             </Row>
             <Row class="row">
@@ -178,7 +178,7 @@
           <div class="list">
             <div class="title row">联系信息</div>
             <Row class="row">
-              <Col span="12">真实姓名: {{ invoiceDetails.real_name }}</Col>
+              <Col span="12">真实姓名: {{ invoiceDetails.name }}</Col>
               <Col span="12">联系电话: {{ invoiceDetails.user_phone }}</Col>
             </Row>
             <Row class="row">
@@ -555,6 +555,7 @@ export default {
       this.timeVal = e;
       this.orderData.data = this.timeVal[0] ? this.timeVal.join('-') : '';
       this.getList();
+      this.getTabs();
     },
     //订单状态搜索()
     selectChange() {