Ejemplo n.º 1
0
 function up_goods($goods)
 {
     $goods_id = intval($goods['goods_id']);
     $data_goods = $goods['data_goods'];
     $data_goods_article = $goods['data_goods_article'];
     $data_goods_attr = $goods['data_goods_attr'];
     $data_goods_cat = $goods['data_goods_cat'];
     $data_goods_gallery = $goods['data_goods_gallery'];
     $data_group_goods = $goods['data_group_goods'];
     $data_link_goods = $goods['data_link_goods'];
     $data_member_price = $goods['data_member_price'];
     $data_volume_price = $goods['data_volume_price'];
     $data_products = $goods['data_products'];
     $syncfield = strim($goods['syncfield']);
     $status = uploadGoods($goods_id, $data_goods, $data_goods_article, $data_goods_attr, $data_goods_cat, $data_goods_gallery, $data_group_goods, $data_link_goods, $data_member_price, $data_volume_price, $data_products, $syncfield);
     $root = array();
     $root['goods_id'] = $goods_id;
     if ($status === 'true') {
         $root['status'] = 1;
         $root['error'] = '';
     } else {
         $root['status'] = 0;
         $root['error'] = $status;
     }
     return $root;
 }
Ejemplo n.º 2
0
function uploadMultiGoodsBase64($username, $password, $goods_List, $syncfield, $delimiter_rn = "51eca_rn", $delimiter_cn = "51eca_cn")
{
    //$username,$password,
    if (!checkLogin($username, $password)) {
        return NULL;
        //login_faild
    }
    //logutils::clear_log();
    $goods_List = base64_decode($goods_List);
    $syncfield = base64_decode($syncfield);
    $delimiter_rn = base64_decode($delimiter_rn);
    $delimiter_cn = base64_decode($delimiter_cn);
    //logutils::log_str( "uploadMultiGoods:". $goods_List);
    $goods_arr = explode("51eca_goods", $goods_List);
    //logutils::log_str( "uploadMultiGoods:-----------------------------------------");
    //logutils::log_obj($goods_arr);
    //logutils::log_str( "uploadMultiGoods:------------------------------------------");
    foreach ($goods_arr as $data) {
        $goods_record = explode("51eca_table", $data);
        //logutils::log_str( "51eca_table:-----------------------------------------");
        //logutils::log_obj($goods_record);
        //logutils::log_str( "51eca_table:------------------------------------------");
        $goods_id = $goods_record[0];
        $data_goods = $goods_record[1];
        $data_goods_article = $goods_record[2];
        $data_goods_attr = $goods_record[3];
        $data_goods_cat = $goods_record[4];
        $data_goods_gallery = $goods_record[5];
        $data_group_goods = $goods_record[6];
        $data_link_goods = $goods_record[7];
        $data_member_price = $goods_record[8];
        $tmp = uploadGoods($goods_id, $data_goods, $data_goods_article, $data_goods_attr, $data_goods_cat, $data_goods_gallery, $data_group_goods, $data_link_goods, $data_member_price, $syncfield, $delimiter_rn, $delimiter_cn);
        $sync_item = array();
        $sync_item['table'] = "ecs_goods";
        $sync_item['guid'] = $goods_id;
        if ($tmp == "true") {
            $sync_item['succ'] = true;
        } else {
            $sync_item['errmsg'] = base64_encode($tmp);
        }
        //logutils::log_obj($sync_item);
        $syncitems[] = $sync_item;
    }
    $pack = array("succ" => true, "items" => $syncitems);
    //logutils::log_obj($pack);
    return $pack;
}