/** * CommonAct::act_GetSkuImg() * 获取sku图片 * @param string $spu 主料号 * @param string $picType 图片类型 * @return string */ public static function act_GetSkuImg() { $spu = isset($_POST['spu']) ? $_POST['spu'] : ''; $sku = isset($_POST['sku']) ? $_POST['sku'] : ''; $picType = isset($_POST['picType']) ? $_POST['picType'] : 'G'; if (empty($spu) || empty($sku)) { self::$errCode = 10000; self::$errMsg = "主/子料号参数有误!"; return false; } $spu = str_pad($spu, 3, "0", STR_PAD_LEFT); $sku = str_pad($sku, 3, "0", STR_PAD_LEFT); $res = CommonModel::getSkuImg($spu, $sku, $picType); return $res; }
/** * CommonAct::act_GetSkuImg() * 获取sku图片 * @param string $spu 主料号 * @param string $picType 图片类型 * @return string */ public static function act_GetSkuImg() { $spu = isset($_REQUEST['spu']) ? $_REQUEST['spu'] : ''; $sku = isset($_REQUEST['sku']) ? $_REQUEST['sku'] : ''; $picType = isset($_REQUEST['picType']) ? $_REQUEST['picType'] : 'G'; //var_dump($spuArr); if (empty($spu)) { self::$errCode = 10000; self::$errMsg = "主料号参数有误!"; return false; } if (empty($sku)) { self::$errCode = 10001; self::$errMsg = "子料号参数有误!"; return false; } if (strlen($spu) == 1) { $spu = '00' . $spu; } if (strlen($spu) == 2) { $spu = '0' . $spu; } if (strlen($sku) == 1) { $sku = '00' . $sku; } if (strlen($sku) == 2) { $sku = '0' . $sku; } $res = CommonModel::getSkuImg($spu, $sku, $picType); //var_dump($res); self::$errCode = CommonModel::$errCode; self::$errMsg = CommonModel::$errMsg; return $res; }