<noframes id="bhrfl"><address id="bhrfl"></address>

    <address id="bhrfl"></address>

    <noframes id="bhrfl"><address id="bhrfl"><th id="bhrfl"></th></address>

    <form id="bhrfl"><th id="bhrfl"><progress id="bhrfl"></progress></th></form>

    <em id="bhrfl"><span id="bhrfl"></span></em>

    全部
    常見問題
    產品動態
    精選推薦

    修復多店后臺導出訂單功能

    管理 管理 編輯 刪除

    問題描述:

    后臺訂單列表導出數量不對。

    解決方法:

    src/pages/order/orderList/components/tableList.vue,找到這個文件,修改exports()方法。

        async exports(value) {
          this.exportListOn = this.exportList.findIndex(
              (item) => item.name === value
          )
          let [th, filekey, data, fileName] = [[], [], [], '']
          let excelData = {
            ...this.where,
            page: 1,
            export_type: value,
            ids: this.checkUidList.join(),
            plat_type: this.currentTab,
          }
          for (let i = 0; i < excelData.page; i++) {
            let lebData = await this.downOrderData(excelData)
            if (!lebData.export.length) {
              break;
            }
            if (!fileName) {
              fileName = lebData.filename
            }
            if (!filekey.length) {
              filekey = lebData.filekey
            }
            if (!th.length) {
              th = lebData.header
            }
            data = data.concat(lebData.export)
            excelData.page++
          }
          let sheetData = []
          for (let j = 0; j < data.length; j++) {
            let goodsList = data[j].goods_name.split('\n')
            for (let k = 0; k < goodsList.length; k++) {
              let row = {...data[j]}
              row.goods_name = goodsList[k]
              if (k) {
                for (const key in row) {
                  if (Object.hasOwnProperty.call(row, key)) {
                    if (key !== 'goods_name') {
                      row[key] = null
                    }
                  }
                }
              }
              sheetData.push(row)
            }
          }
          exportExcel(th, filekey, fileName, sheetData)
        },

    修改完成后需要重新打包。

    打包文檔: https://doc.www.2233z.cn/pro/crmebprov2/2354


    后臺文件修改:app\controller\admin\v1\other\export\ExportExcel

    修改方法:storeOrder()

    public function storeOrder(StoreOrderServices $services)
        {
            $where_tmp = $this->request->getMore([
                ['status', ''],
                ['real_name', ''],
                ['is_del', ''],
                ['data', '', '', 'time'],
    			['type', ''],
                ['export_type', ''],
                ['pay_type', ''],
    			['plat_type', -1],
                ['order', ''],
                ['field_key', ''],
                ['store_id', ''],
                ['supplier_id', ''],
                ['ids', '']
            ]);
            $type = $where_tmp['export_type'];
    		unset($where_tmp['export_type']);
            $with = [];
            if ($where_tmp['ids']) {
                $where['id'] = explode(',', $where_tmp['ids']);
            }
            if ($type) {
                $where['status'] = 1;
                $where['paid'] = 1;
                $where['is_del'] = 0;
                $where['shipping_type'] = 1;
                $where['pid'] = 0;
                $with = ['pink', 'refund' => function ($query) {
    						$query->whereIn('refund_type', [0, 1, 2, 4, 5])->where('is_cancel', 0)->where('is_del', 0)->field('id,store_order_id');
    					}];
            }
            if (!$where_tmp['ids'] && !$type) {
                unset($where_tmp['ids']);
                $where = $where_tmp;
            }
            $where['is_system_del'] = 0;
    		$where['plat_type'] = $where_tmp['plat_type'];
    		$where['store_id'] = $where_tmp['store_id'];
    		$where['supplier_id'] = $where_tmp['supplier_id'];
            if ($where['store_id'] || $where['supplier_id'] || $where['plat_type'] != '' && in_array($where['plat_type'], [0, 1, 2])) {
                $where['pid'] = 0;
            } elseif (!in_array($where['status'], [-1, -2, -3])) {
                $where['pid'] = [0, -1];
            }
            $data = $services->getExportList($where, $with, $this->service->limit);
            return $this->success($this->service->storeOrder($data, $type));
        }


    后臺文件修改:app\services\order\StoreOrderServices

    修改方法:getExportList()

    public function getExportList(array $where, array $with = [], int $limit = 0)
        {
            if ($limit) {
                [$page] = $this->getPageValue();
            } else {
                [$page, $limit] = $this->getPageValue();
            }
            $list = $this->dao->search($where)->with($with)->page($page, $limit)->order('add_time DESC,id DESC')->select()->toArray();
            if ($list) {
    			/** @var  $userServices */
    			$userServices = app()->make(UserServices::class);
    			$userSex = $userServices->getColumn([['uid', 'IN', array_unique(array_column($list, 'uid'))]], 'uid,sex', 'uid');
                foreach ($list as &$item) {
                    /** @var StoreOrderCartInfoServices $orderCart */
                    $orderCart = app()->make(StoreOrderCartInfoServices::class);
                    $_info = $orderCart->getCartColunm(['oid' => $item['id']], 'cart_info', 'unique');
                    foreach ($_info as $k => $v) {
                        $cart_info = is_string($v) ? json_decode($v, true) : $v;
                        if (!isset($cart_info['productInfo'])) $cart_info['productInfo'] = [];
                        $_info[$k] = $cart_info;
                        unset($cart_info);
                    }
                    $item['_info'] = $_info;
                    $item['sex'] = $userSex[$item['uid']]['sex'] ?? '';
    				[$pink_name, $color] = $this->tidyOrderType($item);
                	$item['pink_name'] = $pink_name;
                	$item['color'] = $color;
                }
            }
            return $list;
        }



    請登錄后查看

    全 最后編輯于2024-10-31 16:48:59

    快捷回復
    回復
    回復
    回復({{post_count}}) {{!is_user ? '我的回復' :'全部回復'}}
    排序 默認正序 回復倒序 點贊倒序

    {{item.user_info.nickname ? item.user_info.nickname : item.user_name}} LV.{{ item.user_info.bbs_level }}

    作者 管理員 企業

    {{item.floor}}# 同步到gitee 已同步到gitee {{item.is_suggest == 1? '取消推薦': '推薦'}}
    {{item.is_suggest == 1? '取消推薦': '推薦'}}
    沙發 板凳 地板 {{item.floor}}#
    {{item.user_info.title || '暫無簡介'}}
    附件

    {{itemf.name}}

    {{item.created_at}}  {{item.ip_address}}
    打賞
    已打賞¥{{item.reward_price}}
    {{item.like_count}}
    {{item.showReply ? '取消回復' : '回復'}}
    刪除
    回復
    回復

    {{itemc.user_info.nickname}}

    {{itemc.user_name}}

    回復 {{itemc.comment_user_info.nickname}}

    附件

    {{itemf.name}}

    {{itemc.created_at}}
    打賞
    已打賞¥{{itemc.reward_price}}
    {{itemc.like_count}}
    {{itemc.showReply ? '取消回復' : '回復'}}
    刪除
    回復
    回復
    查看更多
    打賞
    已打賞¥{{reward_price}}
    1432
    {{like_count}}
    {{collect_count}}
    添加回復 ({{post_count}})

    相關推薦

    快速安全登錄

    使用微信掃碼登錄
    {{item.label}} 加精
    {{item.label}} {{item.label}} 板塊推薦 常見問題 產品動態 精選推薦 首頁頭條 首頁動態 首頁推薦
    取 消 確 定
    回復
    回復
    問題:
    問題自動獲取的帖子內容,不準確時需要手動修改. [獲取答案]
    答案:
    提交
    bug 需求 取 消 確 定
    打賞金額
    當前余額:¥{{rewardUserInfo.reward_price}}
    {{item.price}}元
    請輸入 0.1-{{reward_max_price}} 范圍內的數值
    打賞成功
    ¥{{price}}
    完成 確認打賞

    微信登錄/注冊

    切換手機號登錄

    {{ bind_phone ? '綁定手機' : '手機登錄'}}

    {{codeText}}
    切換微信登錄/注冊
    暫不綁定
    亚洲欧美字幕
    CRMEB客服

    CRMEB咨詢熱線 咨詢熱線

    400-8888-794

    微信掃碼咨詢

    CRMEB開源商城下載 源碼下載 CRMEB幫助文檔 幫助文檔
    返回頂部 返回頂部
    CRMEB客服