<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>

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

    易聯云小票打印兼容問題

    管理 管理 編輯 刪除

    問題說明:易聯云小票打印兼容問題

    修改文件:app\services\message\SystemPrinterServices

    修改方法:ylyContent()

    public function ylyContent($printContent, $config, $print_num, $print_event)
        {
            $orderInfo = $config['orderInfo'];
            $product = $config['product'];
            $name = $config['name'];
            $goodsStr = '<table><tr><td>名稱</td><td>單價</td><td>數量</td><td>金額</td></tr>';
            foreach ($product as $item) {
                $goodsStr .= '<tr><td><FH2><FW2>----------------</FW2></FH2></td></tr>';
                $goodsStr .= '<tr>';
                $price = $item['sum_price'];
                $num = $item['cart_num'];
                $prices = bcmul((string)$item['cart_num'], (string)$item['sum_price'], 2);
                $goodsStr .= "<td>{$item['productInfo']['store_name']} | {$item['productInfo']['attrInfo']['suk']}</td><td>{$price}</td><td>{$num}</td><td>{$prices}</td>";
                $goodsStr .= '</tr>';
                if (in_array(1, $printContent['goods'])) {
                    $goodsStr .= '<tr>';
                    $goodsStr .= "<td>規格編碼:{$item['productInfo']['attrInfo']['code']}</td>";
                    $goodsStr .= '</tr>';
                }
                unset($price, $num, $prices);
            }
            $goodsStr .= '</table>';
            $total_price = bcadd($orderInfo['total_price'], $orderInfo['pay_postage'], 2);
            $addTime = date('Y-m-d H:i:s', $orderInfo['add_time']);
            $payTime = isset($orderInfo['pay_time']) ? date('Y-m-d H:i:s', $orderInfo['pay_time']) : '';
            $printTime = date('Y-m-d H:i:s', time());
    
            $content = '';
            $content .= '<MN>' . $print_num . '</MN>';
            if ($printContent['header']) {
                if (in_array(0, $printContent['header'])) {
                    $content .= '<FS2><center>' . $name . '</center></FS2>';
                }
                if (in_array(1, $printContent['header']) && $orderInfo['store_id']) {
                    /** @var SystemStoreServices $storeServices */
                    $storeServices = app()->make(SystemStoreServices::class);
                    $store_name = $storeServices->value(['id' => $orderInfo['store_id']], 'name');
                    $content .= '<FS2><center>' . $store_name . '</center></FS2>';
                }
                $content .= '<FH2><FW2>----------------</FW2></FH2>';
            }
            if ($printContent['delivery']) {
                if (in_array(0, $printContent['delivery'])) {
                    if ($orderInfo['shipping_type'] == 1) {
                        $content .= "配送方式:商家配送 \r";
                    } else {
                        $content .= "配送方式:門店自提 \r";
                    }
                }
                if (in_array(1, $printContent['delivery'])) {
                    $content .= '客戶姓名: ' . $orderInfo['real_name'] . " \r";
                }
                if (in_array(2, $printContent['delivery'])) {
                    $content .= '客戶電話: ' . $orderInfo['user_phone'] . " \r";
                }
                if (in_array(3, $printContent['delivery'])) {
                    if ($orderInfo['shipping_type'] == 1) $content .= '收貨地址: ' . $orderInfo['user_address'] . " \r";
                }
                $content .= '<FH2><FW2>----------------</FW2></FH2>';
            }
            if ($printContent['buyer_remarks']) {
                $content .= '買家備注: ' . $orderInfo['mark'] . " \r";
                $content .= '<FH2><FW2>----------------</FW2></FH2>';
            }
            if (in_array(0, $printContent['goods'])) {
                $content .= '*************商品***************';
                $content .= "      \r";
                $content .= $goodsStr;
                $content .= "********************************\r";
                $content .= '<FH2><FW2>----------------</FW2></FH2>';
            }
            if ($printContent['freight']) {
                $content .= '<RA>郵費:' . $orderInfo['pay_postage'] . '元</RA>';
                $content .= '<RA>合計:' . $total_price . '元</RA>';
                $content .= '<FH2><FW2>----------------</FW2></FH2>';
            }
            if ($printContent['preferential']) {
                $discount_price = bcsub(bcadd($orderInfo['total_price'], $orderInfo['pay_postage'], 2), bcadd($orderInfo['deduction_price'], $orderInfo['pay_price'], 2), 2);
                $content .= '<RA>優惠:-' . $discount_price . '元</RA>';
                $content .= '<RA>抵扣:-' . $orderInfo['deduction_price'] . '元</RA>';
                $content .= '<FH2><FW2>----------------</FW2></FH2>';
            }
            if (in_array(0, $printContent['pay'])) {
                if ($print_event == 2) {
                    switch ($orderInfo['pay_type']) {
                        case 'weixin':
                            '<RA>支付方式:微信支付</RA>';
                            break;
                        case 'alipay':
                            '<RA>支付方式:支付寶支付</RA>';
                            break;
                        case 'yue':
                            '<RA>支付方式:余額支付</RA>';
                            break;
                        case 'offline':
                            '<RA>支付方式:線下支付</RA>';
                            break;
                        default:
                            '<RA>支付方式:暫無</RA>';
                    }
                } else {
                    $content .= '<RA>支付方式:暫無</RA>';
                }
            }
            if (in_array(1, $printContent['pay'])) {
                $content .= '<RA>實際支付:' . $orderInfo['pay_price'] . '元</RA>';
            }
            if (count($printContent['pay'])) {
                $content .= '<FH2><FW2>----------------</FW2></FH2>';
            }
            if (in_array(0, $printContent['order'])) {
                $content .= '訂單編號:' . $orderInfo['order_id'] . "\r";
            }
            if (in_array(1, $printContent['order'])) {
                $content .= '下單時間:' . $addTime . "\r";
            }
            if (in_array(2, $printContent['order'])) {
                $content .= '支付時間:' . $payTime . "\r";
            }
            if (in_array(3, $printContent['order'])) {
                $content .= '打印時間:' . $printTime . "\r";
            }
            $content .= '<FH2><FW2>----------------</FW2></FH2>';
            if ($printContent['code'] && $printContent['code_url']) {
                $content .= '<QR>' . sys_config('site_url') . $printContent['code_url'] . '</QR>';
                $content .= "      \r";
            }
            if ($printContent['show_notice']) {
                $content .= '<center>' . $printContent['notice_content'] . '</center>';
                $content .= "      \r";
            }
            return $content;
        }


    修改方法:ylyTableContent()

    public function ylyTableContent($printContent, $config, $print_num, $print_event)
        {
            $product = $config['product'];
            $tableInfo = $config['tableInfo'];
            $name = $config['name'];
            $goodsStr = '<table><tr><td>名稱</td><td>單價</td><td>數量</td><td>金額</td></tr>';
            foreach ($product as $item) {
                $goodsStr .= '<tr><td><FH2><FW2>----------------</FW2></FH2></td></tr>';
                $goodsStr .= '<tr>';
                $price = $item['sum_price'];
                $num = $item['cart_num'];
                $prices = bcmul((string)$item['cart_num'], (string)$item['sum_price'], 2);
                $goodsStr .= "<td>{$item['productInfo']['store_name']} | {$item['productInfo']['attrInfo']['suk']}</td><td>{$price}</td><td>{$num}</td><td>{$prices}</td>";
                $goodsStr .= '</tr>';
                if (in_array(1, $printContent['goods'])) {
                    $goodsStr .= '<tr>';
                    $goodsStr .= "<td>規格編碼:{$item['productInfo']['attrInfo']['code']}</td>";
                    $goodsStr .= '</tr>';
                }
                unset($price, $num, $prices);
            }
            $goodsStr .= '</table>';
            $printTime = date('Y-m-d H:i:s', time());
    
            $content = '';
            $content .= '<MN>' . $print_num . '</MN>';
            if ($printContent['header']) {
                if (in_array(0, $printContent['header'])) {
                    $content .= '<FS2><center>' . $name . '</center></FS2>';
                }
                if (in_array(1, $printContent['header'])) {
                    /** @var SystemStoreServices $storeServices */
                    $storeServices = app()->make(SystemStoreServices::class);
                    $store_name = $storeServices->value(['id' => $tableInfo['store_id']], 'name');
                    $content .= '<FS2><center>' . $store_name . '</center></FS2>';
                }
                /** @var TableQrcodeServices $qrcodeService */
                $qrcodeService = app()->make(TableQrcodeServices::class);
                $Info = $qrcodeService->getQrcodeyInfo((int)$tableInfo['qrcode_id'], ['category']);
                if (in_array(2, $printContent['header'])) {
                    $content .= '<RA>桌碼流水:' . $tableInfo['serial_number'] . '</RA>';
                }
                if (in_array(3, $printContent['header'])) {
                    $content .= '<RA>桌碼分類:' . $Info['category']['name'] . '</RA>';
                }
                if (in_array(4, $printContent['header'])) {
                    $content .= '<RA>桌碼編號:' . $Info['table_number'] . '</RA>';
                }
                $content .= '<FH2><FW2>----------------</FW2></FH2>';
            }
            if (in_array(0, $printContent['goods'])) {
                $content .= '*************商品***************';
                $content .= "      \r";
                $content .= $goodsStr;
                $content .= "********************************\r";
                $content .= '<FH2><FW2>----------------</FW2></FH2>';
            }
    
            if (in_array(3, $printContent['order'])) {
                $content .= '打印時間:' . $printTime . "\r";
            }
            $content .= '<FH2><FW2>----------------</FW2></FH2>';
            if ($printContent['code'] && $printContent['code_url']) {
                $content .= '<QR>' . sys_config('site_url') . $printContent['code_url'] . '</QR>';
                $content .= "      \r";
            }
            if ($printContent['show_notice']) {
                $content .= '<center>' . $printContent['notice_content'] . '</center>';
                $content .= "      \r";
            }
            return $content;
        }


    請登錄后查看

    全 最后編輯于2024-11-06 17:29:06

    快捷回復
    回復
    回復
    回復({{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}}
    1773
    {{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客服