我要将一个本地主机项目迁移到上面有cpanel的服务器上,该项目在那里并且大多数正在按预期运行。除了输入功能外,由于某种原因,这些数字很奇怪。
这是功能
geocode(df[x,"col_name"], service="bing", returntype="coordinates")
这是本地项目的输出
public function store(Request $request)
{
ini_set('max_execution_time', 300);
$products = $request->all();
$countries = ['COSTA RICA', 'NICARAGUA', 'HONDURAS'];
try {
DB::beginTransaction();
foreach ($products as $product) {
Log::info($product);
$dbProduct = $this->getProduct($product['SKU']);
// Log::error($dbProduct);
$dbProduct->code = $product['CODIGO'];
$dbProduct->sku = $product['SKU'];
$dbProduct->description_spanish = $product['DESCRIPCION - ESPAÑOL'];
$dbProduct->description_english = $product['DESCRIPCION - INGLES'];
$dbProduct->image = 'img/products/' . $product['SKU'] . '.jpg';
$dbProduct->discount = $product['DESCUENTO'];
$dbProduct->cif = $product['FOB'];
$dbProduct->color = (isset($product['COLOR'])) ? ($product['COLOR']) : '';
$dbProduct->color_ab = (isset($product['COLOR-AB'])) ? ($product['COLOR-AB']) : '';
$this->isSet('PROVEEDOR', $product);
$provider = $this->getProvider($product['PROVEEDOR']);
$this->isSet('MARCA', $product);
$brand = $this->getBrand($product['MARCA'], $provider->id);
$dbProduct->brand_id = $brand->id;
$dbProduct->save();
$dbProduct->tags()->detach();
if (isset($product['ETIQUETAS DE RELACION'])) {
foreach (explode(',', str_replace(' ', '', $product['ETIQUETAS DE RELACION'])) as $etiqueta) {
$tag = $this->getTag($etiqueta);
// Log::error($tag);
$dbProduct->tags()->attach($tag->id);
}
}
foreach ($countries as $country) {
$c = $this->getCountry($country);
if (isset($product["FI $country"]) && isset($product["Margen $country"])) {
$fi = $product["FI $country"];
$margin = $product["Margen $country"];
$factor = $this->getExportationFactor($c->id, $dbProduct->id, $margin, $fi);
Log::info('new factor '.$factor);
Log::info('fi '. $product["FI $country"]);
Log::info('margen '. $product["Margen $country"]);
}
if (isset($product["PRECIO $country"])) {
$price = $this->getCountryProduct($c->id, $dbProduct->id, $product["PRECIO $country"]);
Log::info('price '.$price);
Log::info('price: '. $product["PRECIO $country"]);
}
}
$sizes = $this->filterArray($product, "Talla");
$dbProduct->sizes()->detach();
foreach ($sizes as $key => $value) {
$size = $this->getSize($key);
$dbProduct->sizes()->attach($size->id);
}
$dbProduct->fields()->detach();
$tables = $this->filterArray($product, "tabla");
$this->fillProductField($tables, $dbProduct->id, 'table');
$lists = $this->filterArray($product, "lista");
$this->fillProductField($lists, $dbProduct->id, 'list');
}
DB::commit();
} catch (Exception $e) {
DB::rollBack();
throw new HttpException(500, 'Sucedio un error importando la información favor intentar de nuevo');
}
}
这是服务器的输出
local.INFO: array (
'CODIGO' => '62NBB',
'SKU' => '62NBB',
'ETIQUETAS DE RELACION' => 'Casco, Standard Series, Almohadilla, Ventilación, Ratchet',
'PROVEEDOR' => 'Bullard',
'DESCRIPCION - ESPAÑOL' => 'Casco, Estilo Standard Series con ventilación, Con almohadilla de vinilo, Suspensión Ratchet de 4 puntos, Talla única, Color Azul Navy',
'DESCRIPCION - INGLES' => '4pt, Ratchet Vinyl Brow Pad, Standard Series Vented Cap Style, Navy Blue',
'DESCUENTO' => 0.07,
'COLOR-AB' => 'NB',
'COLOR' => 'NAVY BLUE',
'MARCA' => 'Bullard',
'FOB' => 8.54,
'FI COSTA RICA' => 0.85,
'Margen COSTA RICA' => 0.65,
'FI NICARAGUA' => 0.82,
'Margen NICARAGUA' => 0.65,
'FI HONDURAS' => 0.75,
'Margen HONDURAS' => 0.65,
'Costo CR' => 10.047058823529412,
'Costo Nic' => 10.414634146341463,
'Costo Hn' => 11.386666666666665,
'PRECIO COSTA RICA' => 15.457013574660632,
'PRECIO NICARAGUA' => 16.02251407129456,
'PRECIO HONDURAS' => 17.517948717948716,
'lista-Detalles de compra -Detalle 1' => 'Unidad del precio: ea.',
'lista-Detalles de compra -Detalle 2' => 'Minimo de compra 20',
'lista-Detalles de compra -Detalle 3' => 'Cantidad por caja 20',
)
local.INFO: new factor {"country_id":1,"product_id":415,"margin":0.65,"fi":0.85,"id":1237}
local.INFO: fi 0.85
local.INFO: margen 0.65
local.INFO: price {"country_id":1,"product_id":415,"price":15.457013574660632,"id":1235}
local.INFO: price: 15.457013574661
local.INFO: new factor {"country_id":2,"product_id":415,"margin":0.65,"fi":0.82,"id":1238}
local.INFO: fi 0.82
local.INFO: margen 0.65
local.INFO: price {"country_id":2,"product_id":415,"price":16.02251407129456,"id":1236}
local.INFO: price: 16.022514071295
local.INFO: new factor {"country_id":3,"product_id":415,"margin":0.65,"fi":0.75,"id":1239}
local.INFO: fi 0.75
local.INFO: margen 0.65
local.INFO: price {"country_id":3,"product_id":415,"price":17.517948717948716,"id":1237}
local.INFO: price: 17.517948717949
由于这是同一项目,因此两者的代码完全相同,我不知道服务器项目有什么问题吗?当我尝试编辑产品时,这会引起问题,因为fi和margin不会显示,并且我认为它与输出结果的差异有关。
会发生什么?