示例#1
0
 function getImgList($dir)
 {
     global $ST, $CONFIG;
     $d = opendir($dir);
     while ($file = readdir($d)) {
         if ($file != '.' && $file != '..') {
             if (is_dir($dir . '/' . $file)) {
                 getImgList($dir . '/' . $file);
             } else {
                 $ext_id = preg_replace('/\\.[a-z]+$/', '', $file);
                 //								$rs=$ST->select("SELECT id FROM sc_shop_item WHERE ext_id='$ext_id'");
                 $rs = $ST->select("SELECT i.id FROM sc_shop_item i,sc_shop_item_tmp it WHERE i.ext_id=it.id AND it.img='{$ext_id}'");
                 if ($rs->next()) {
                     copy($dir . '/' . $file, '.' . $CONFIG['CATALOG_PATH'] . '/goods/' . $file);
                     $ST->update('sc_shop_item', array('img' => $CONFIG['CATALOG_PATH'] . '/goods/' . $file), 'id=' . $rs->get('id'));
                 }
             }
         }
     }
     closedir($d);
 }
示例#2
0
}
if (in_array(5, $paytypeArr)) {
    $GLOBALS['condition']['_hasqianbao'] = 1;
}
if (in_array(7, $paytypeArr)) {
    $GLOBALS['condition']['_hasbeibao'] = 1;
}
if (in_array(8, $paytypeArr)) {
    $GLOBALS['condition']['_hasweixin'] = 1;
}
if (is_array($row)) {
    $row['enddatetime'] = date('Y/m/d H:i:s', $row['endtime']);
    //截止时间
    $row['discount'] = floor($row['price'] / $row['sellprice'] * 100) / 10;
    //折扣
    $row['piclist'] = getImgList($row['piclist']);
    //获取轮播图片
    $row['seokeyword'] = empty($row['keyword']) ? '' : "<meta name=\"keywords\" content=\"{$row['keyword']}\"/>";
    $row['seodescription'] = empty($row['description']) ? '' : "<meta name=\"description\" content=\"{$row['description']}\"/>";
    $row['seotitle'] = empty($row['seotitle']) ? $row['title'] : $row['seotitle'];
    $row['booknum'] = Helper_Archive::getSellNum($row['id'], 13) + $row['virtualnum'];
    $row['typename'] = GetTypeName($typeid);
    $row['satisfyscore'] = empty($row['satisfyscore']) ? $row['satisfyscore'] : $row['satisfyscore'] . '%';
    foreach ($row as $k => $v) {
        $pv->Fields[$k] = $v;
        //模板变量赋值
    }
}
$templets = $row['templet'];
if (strpos($templets, 'uploadtemplets') !== false) {
    $templet = SLINETEMPLATE . '/smore/' . $templets . '/index.htm';