예제 #1
0
파일: goods.php 프로젝트: dlpc/ecshop
    $opt = array();
    foreach ($arr as $val) {
        $opt[] = array('value' => $val['article_id'], 'text' => $val['title'], 'data' => '');
    }
    clear_cache_files();
    make_json_result($opt);
} elseif ($_REQUEST['act'] == 'drop_goods_article') {
    include_once ROOT_PATH . 'includes/cls_json.php';
    $json = new JSON();
    check_authz_json('goods_manage');
    $articles = $json->decode($_GET['drop_ids']);
    $arguments = $json->decode($_GET['JSON']);
    $goods_id = $arguments[0];
    $sql = "DELETE FROM " . $ecs->table('goods_article') . " WHERE " . db_create_in($articles, "article_id") . " AND goods_id = '{$goods_id}'";
    $db->query($sql);
    $arr = get_goods_articles($goods_id);
    $opt = array();
    foreach ($arr as $val) {
        $opt[] = array('value' => $val['article_id'], 'text' => $val['title'], 'data' => '');
    }
    clear_cache_files();
    make_json_result($opt);
} elseif ($_REQUEST['act'] == 'product_list') {
    admin_priv('goods_manage');
    /* 是否存在商品id */
    if (empty($_GET['goods_id'])) {
        $link[] = array('href' => 'goods.php?act=list', 'text' => $_LANG['cannot_found_goods']);
        sys_msg($_LANG['cannot_found_goods'], 1, $link);
    } else {
        $goods_id = intval($_GET['goods_id']);
    }
예제 #2
0
파일: goods.php 프로젝트: 554119220/kjrscrm
         $db->autoExecute($ecs->table('goods_attr'), addslashes_deep($row), 'INSERT');
     }
 }
 // 扩展分类
 $other_cat_list = array();
 $sql = "SELECT cat_id FROM " . $ecs->table('goods_cat') . " WHERE goods_id = '{$_REQUEST['goods_id']}'";
 $goods['other_cat'] = $db->getCol($sql);
 foreach ($goods['other_cat'] as $cat_id) {
     $other_cat_list[$cat_id] = cat_list(0, $cat_id);
 }
 $smarty->assign('other_cat_list', $other_cat_list);
 $link_goods_list = get_linked_goods($goods['goods_id']);
 // 关联商品
 $group_goods_list = get_group_goods($goods['goods_id']);
 // 配件
 $goods_article_list = get_goods_articles($goods['goods_id']);
 // 关联文章
 /* 商品图片路径 */
 if (isset($GLOBALS['shop_id']) && $GLOBALS['shop_id'] > 10 && !empty($goods['original_img'])) {
     $goods['goods_img'] = get_image_path($_REQUEST['goods_id'], $goods['goods_img']);
     $goods['goods_thumb'] = get_image_path($_REQUEST['goods_id'], $goods['goods_thumb'], true);
 }
 /* 图片列表 */
 $sql = "SELECT * FROM " . $ecs->table('goods_gallery') . " WHERE goods_id = '{$goods['goods_id']}'";
 $img_list = $db->getAll($sql);
 /* 格式化相册图片路径 */
 if (isset($GLOBALS['shop_id']) && $GLOBALS['shop_id'] > 0) {
     foreach ($img_list as $key => $gallery_img) {
         $gallery_img[$key]['img_url'] = get_image_path($gallery_img['goods_id'], $gallery_img['img_original'], false, 'gallery');
         $gallery_img[$key]['thumb_url'] = get_image_path($gallery_img['goods_id'], $gallery_img['img_original'], true, 'gallery');
     }