ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

聯(lián)系官方銷售客服

1835022288

028-61286886

投訴 已解決 API接口通用訂單列表中訂單商品縮略圖回調(diào)怎么寫 2 0
迅睿CMS版本:4.6.1 懸賞:1元 #通用訂單 #欄目名稱

API接口通用訂單列表中訂單商品縮略圖回調(diào)怎么寫?

通用訂單-我的訂單,API接口返回的是

data>list>0>godds>0


image

以下回調(diào)只能寫到訂單信息,還要加一層訂單里面商品信息(goods)

$rt = [];
if ($data) {
    foreach ($data['list'] as $t) {
        $rt[] = [
            'sn' => $t['sn'], // 標題
            'title' => $t['title'], // 標題
            'id' => $t['id'], // id號
            'uid' => $t['uid'], // id號
            'mid' => $t['mid'], // id號
            'catname' => dr_cat_value('news', $t['catid'], 'name'), // news模塊的當前內(nèi)容欄目名稱
            'price' => $t['price'], // news模塊的當前內(nèi)容欄目名稱
            'quantity' => $t['quantity'], // news模塊的當前內(nèi)容欄目名稱
            'sku_name' => $t['sku_name'], // news模塊的當前內(nèi)容欄目名稱
            'sku_value' => $t['sku_value'], // news模塊的當前內(nèi)容欄目名稱
            'thumb' => dr_thumb($t['thumb'], 200, 200), // 圖片id轉(zhuǎn)換為地址
            'updatetime' => dr_date($t['inputtime'], 'Y-m-d H:i:s'), // 時間轉(zhuǎn)換
            'goods' => $t['goods'], // goods
        ];
    }
}
return $rt;

'goods' => $t['goods'], // goods
這里面的縮略圖回調(diào)

解決方案
  • $rt = [];
    if ($data) {
        foreach ($data['list'] as $t) {
        foreach($t['goods'] as $i => $v) {
            $t['goods'][$i]['thumb']=dr_get_file($v['thumb']);
        }
            $rt[] = [
                'sn' => $t['sn'], // 標題
                'title' => $t['title'], // 標題
                'id' => $t['id'], // id號
                'uid' => $t['uid'], // id號
                'mid' => $t['mid'], // id號
                'catname' => dr_cat_value('news', $t['catid'], 'name'), // news模塊的當前內(nèi)容欄目名稱
                'price' => $t['price'], // news模塊的當前內(nèi)容欄目名稱
                'quantity' => $t['quantity'], // news模塊的當前內(nèi)容欄目名稱
                'sku_name' => $t['sku_name'], // news模塊的當前內(nèi)容欄目名稱
                'sku_value' => $t['sku_value'], // news模塊的當前內(nèi)容欄目名稱
                'thumb' => dr_thumb($t['thumb'], 200, 200), // 圖片id轉(zhuǎn)換為地址
                'updatetime' => dr_date($t['inputtime'], 'Y-m-d H:i:s'), // 時間轉(zhuǎn)換
                'goods' => $t['goods'], // goods
            ];
        }
    }
    return $rt;
    滿意答案
    開源積分+10
    +1元
  • @不恥下問 官方技術(shù)員寫的這么完美 解決了嗎
    訊睿對接微信小程序,接各類訂單
  • @迅睿框架技術(shù)-阿鋒:完結(jié)完結(jié)完結(jié)完結(jié)