Merge branch '551-check-for-null-sku-for-warranty' into 'master'
Resolve "Check for null sku for warranty" Closes #551 See merge request jankstudio/resq!654
This commit is contained in:
commit
0713bd9441
13 changed files with 3403 additions and 1313 deletions
4128
composer.lock
generated
4128
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -2977,7 +2977,11 @@ class APIController extends Controller implements LoggedController
|
|||
}
|
||||
|
||||
$sku = $warr_serial->getSKU();
|
||||
$batt = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
|
||||
// check if sku is null
|
||||
$batt = null;
|
||||
if ($sku != null)
|
||||
$batt = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
// TODO: put this in a config file
|
||||
$image_url = $req->getSchemeAndHttpHost() . '/battery/generic.png';
|
||||
if ($batt != null)
|
||||
|
|
@ -3120,7 +3124,7 @@ class APIController extends Controller implements LoggedController
|
|||
if (!$is_customer_warranty)
|
||||
{
|
||||
$res->setError(true)
|
||||
->setErrorMessage('Warranty registred to a vehicle not in your list of vehicles.');
|
||||
->setErrorMessage('Warranty registered to a vehicle not in your list of vehicles.');
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
|
@ -3132,15 +3136,12 @@ class APIController extends Controller implements LoggedController
|
|||
$sms_msg = $trans->trans('warranty_register_confirm');
|
||||
}
|
||||
|
||||
// check if sku is null
|
||||
// get sap battery
|
||||
$sku = $warr_serial->getSKU();
|
||||
$sap_bty = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
if ($sap_bty == null)
|
||||
{
|
||||
$res->setError(true)
|
||||
->setErrorMessage('Could not find battery entry for warranty.');
|
||||
return $res;
|
||||
}
|
||||
$sap_bty = null;
|
||||
if ($sku != null)
|
||||
$sap_bty = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
|
||||
// default date purchase to today
|
||||
// NOTE: might need to change this later
|
||||
|
|
|
|||
|
|
@ -232,7 +232,11 @@ class CustomerWarrantyController extends APIController
|
|||
}
|
||||
|
||||
$sku = $warr_serial->getSKU();
|
||||
$batt = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
// check if sku is null
|
||||
$batt = null;
|
||||
if ($sku != null)
|
||||
$batt = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
|
||||
// TODO: put this in a config file
|
||||
$image_url = $req->getSchemeAndHttpHost() . '/battery/generic.png';
|
||||
if ($batt != null)
|
||||
|
|
@ -279,6 +283,8 @@ class CustomerWarrantyController extends APIController
|
|||
{
|
||||
error_log('HERE - register');
|
||||
// check required parameters
|
||||
// TODO: maybe add vmake_id? since warranty cannot be created with no vmake
|
||||
// TODO: maye also add mobile and email since customer creation won't let mobile and email be null
|
||||
$required_params = [
|
||||
'first_name',
|
||||
'last_name',
|
||||
|
|
@ -381,10 +387,16 @@ class CustomerWarrantyController extends APIController
|
|||
error_log('sap battery check');
|
||||
// get sap battery
|
||||
$sku = $warr_serial->getSKU();
|
||||
$sap_bty = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
if ($sap_bty == null)
|
||||
$sap_bty = null;
|
||||
|
||||
// check if sku is null
|
||||
if ($sku != null)
|
||||
{
|
||||
return new APIResponse(false, 'Could not find battery entry for warranty.');
|
||||
$sap_bty = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
//if ($sap_bty == null)
|
||||
//{
|
||||
// return new APIResponse(false, 'Could not find battery entry for warranty.');
|
||||
//}
|
||||
}
|
||||
|
||||
// vehicle fetch
|
||||
|
|
@ -403,15 +415,19 @@ class CustomerWarrantyController extends APIController
|
|||
// default date purchase to today
|
||||
// NOTE: might need to change this later
|
||||
$date_pur = new DateTime();
|
||||
$date_pur_cust = new DateTime();
|
||||
|
||||
// get date purchase specified by customer
|
||||
$date_pur_cust = DateTime::createFromFormat('Y-m-d', $req->request->get('date_purchase'));
|
||||
if (!$date_pur_cust)
|
||||
if (!empty($req->request->get('date_purchase')))
|
||||
{
|
||||
return new APIResponse(false, 'Invalid date format for date of purchase.');
|
||||
$date_pur_cust = DateTime::createFromFormat('Y-m-d', $req->request->get('date_purchase'));
|
||||
if (!$date_pur_cust)
|
||||
{
|
||||
return new APIResponse(false, 'Invalid date format for date of purchase.');
|
||||
}
|
||||
}
|
||||
|
||||
// chstomer check
|
||||
// customer check
|
||||
$priv_promo = $req->request->get('priv_promo', false);
|
||||
if ($cust == null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -199,10 +199,16 @@ class WarrantyController extends APIController
|
|||
if (!$plate)
|
||||
return new APIResponse(false, 'Invalid plate number.');
|
||||
|
||||
// battery
|
||||
$batt = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
if ($batt == null)
|
||||
return new APIResponse(false, 'Invalid battery SKU.');
|
||||
// check if sku is blank
|
||||
if ((empty($sku)) || ($sku == null))
|
||||
$batt = null;
|
||||
else
|
||||
{
|
||||
// battery
|
||||
$batt = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
if ($batt == null)
|
||||
return new APIResponse(false, 'Invalid battery SKU.');
|
||||
}
|
||||
|
||||
/*
|
||||
// battery model
|
||||
|
|
@ -382,10 +388,16 @@ class WarrantyController extends APIController
|
|||
if (!$plate)
|
||||
return new APIResponse(false, 'Invalid plate number.');
|
||||
|
||||
// battery
|
||||
$batt = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
if ($batt == null)
|
||||
return new APIResponse(false, 'Invalid battery SKU.');
|
||||
// check if sku is blank
|
||||
if ((empty($sku)) || ($sku == null))
|
||||
$batt = null;
|
||||
else
|
||||
{
|
||||
// battery
|
||||
$batt = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
if ($batt == null)
|
||||
return new APIResponse(false, 'Invalid battery SKU.');
|
||||
}
|
||||
|
||||
$warr->setSerial($serial)
|
||||
->setWarrantyClass($warr_class)
|
||||
|
|
@ -634,6 +646,7 @@ class WarrantyController extends APIController
|
|||
$w_last_name = $warranty->getLastName();
|
||||
|
||||
$new_cust = new Customer();
|
||||
// TODO: add customer source
|
||||
$new_cust->setFirstName($w_first_name)
|
||||
->setLastName($w_last_name)
|
||||
->setPhoneMobile($w_mobile_num);
|
||||
|
|
|
|||
|
|
@ -181,31 +181,52 @@ class WarrantyController extends Controller
|
|||
}
|
||||
|
||||
// custom validation for battery model
|
||||
$model = $em->getRepository(BatteryModel::class)
|
||||
->find($req->request->get('battery_model'));
|
||||
// check if battery model is blank
|
||||
$bmodel = $req->request->get('battery_model');
|
||||
if (!empty($bmodel))
|
||||
{
|
||||
$model = $em->getRepository(BatteryModel::class)
|
||||
->find($req->request->get('battery_model'));
|
||||
|
||||
if (empty($model))
|
||||
$error_array['battery_model'] = 'Invalid model selected.';
|
||||
if (empty($model))
|
||||
$error_array['battery_model'] = 'Invalid model selected.';
|
||||
else
|
||||
$obj->setBatteryModel($model);
|
||||
}
|
||||
else
|
||||
$obj->setBatteryModel($model);
|
||||
$obj->setBatteryModel(NULL);
|
||||
|
||||
// custom validation for battery size
|
||||
$size = $em->getRepository(BatterySize::class)
|
||||
->find($req->request->get('battery_size'));
|
||||
// check if battery size is blank
|
||||
$bsize = $req->request->get('battery_size');
|
||||
if (!empty($bsize))
|
||||
{
|
||||
$size = $em->getRepository(BatterySize::class)
|
||||
->find($req->request->get('battery_size'));
|
||||
|
||||
if (empty($size))
|
||||
$error_array['battery_size'] = 'Invalid size selected.';
|
||||
if (empty($size))
|
||||
$error_array['battery_size'] = 'Invalid size selected.';
|
||||
else
|
||||
$obj->setBatterySize($size);
|
||||
}
|
||||
else
|
||||
$obj->setBatterySize($size);
|
||||
$obj->setBatterySize(NULL);
|
||||
|
||||
// custom validation for SAP battery
|
||||
$sap = $em->getRepository(SAPBattery::class)
|
||||
->find($req->request->get('sap_battery'));
|
||||
// check if sap battery is blank
|
||||
$sap_battery = $req->request->get('sap_battery');
|
||||
if (!empty($sap_battery))
|
||||
{
|
||||
$sap = $em->getRepository(SAPBattery::class)
|
||||
->find($req->request->get('sap_battery'));
|
||||
|
||||
if (empty($sap))
|
||||
$error_array['sap_battery'] = 'Invalid SAP battery selected.';
|
||||
if (empty($sap))
|
||||
$error_array['sap_battery'] = 'Invalid SAP battery selected.';
|
||||
else
|
||||
$obj->setSAPBattery($sap);
|
||||
}
|
||||
else
|
||||
$obj->setSAPBattery($sap);
|
||||
$obj->setSAPBattery(NULL);
|
||||
|
||||
// validate
|
||||
$errors = $validator->validate($obj);
|
||||
|
|
@ -303,31 +324,52 @@ class WarrantyController extends Controller
|
|||
}
|
||||
|
||||
// custom validation for battery model
|
||||
$model = $em->getRepository(BatteryModel::class)
|
||||
->find($req->request->get('battery_model'));
|
||||
// check if battery model is blank
|
||||
$bmodel = $req->request->get('battery_model');
|
||||
if (!empty($bmodel))
|
||||
{
|
||||
$model = $em->getRepository(BatteryModel::class)
|
||||
->find($req->request->get('battery_model'));
|
||||
|
||||
if (empty($model))
|
||||
$error_array['battery_model'] = 'Invalid model selected.';
|
||||
if (empty($model))
|
||||
$error_array['battery_model'] = 'Invalid model selected.';
|
||||
else
|
||||
$obj->setBatteryModel($model);
|
||||
}
|
||||
else
|
||||
$obj->setBatteryModel($model);
|
||||
$obj->setBatteryModel(null);
|
||||
|
||||
// custom validation for battery size
|
||||
$size = $em->getRepository(BatterySize::class)
|
||||
->find($req->request->get('battery_size'));
|
||||
// check if battery size is blank
|
||||
$bsize = $req->request->get('battery_size');
|
||||
if (!empty($bsize))
|
||||
{
|
||||
$size = $em->getRepository(BatterySize::class)
|
||||
->find($req->request->get('battery_size'));
|
||||
|
||||
if (empty($size))
|
||||
$error_array['battery_size'] = 'Invalid size selected.';
|
||||
if (empty($size))
|
||||
$error_array['battery_size'] = 'Invalid size selected.';
|
||||
else
|
||||
$obj->setBatterySize($size);
|
||||
}
|
||||
else
|
||||
$obj->setBatterySize($size);
|
||||
$obj->setBatterySize(null);
|
||||
|
||||
// custom validation for SAP battery
|
||||
$sap = $em->getRepository(SAPBattery::class)
|
||||
->find($req->request->get('sap_battery'));
|
||||
// check if sap battery is blank
|
||||
$sap_battery = $req->request->get('sap_battery');
|
||||
if (!empty($sap_battery))
|
||||
{
|
||||
$sap = $em->getRepository(SAPBattery::class)
|
||||
->find($req->request->get('sap_battery'));
|
||||
|
||||
if (empty($sap))
|
||||
$error_array['sap_battery'] = 'Invalid SAP battery selected.';
|
||||
if (empty($sap))
|
||||
$error_array['sap_battery'] = 'Invalid SAP battery selected.';
|
||||
else
|
||||
$obj->setSAPBattery($sap);
|
||||
}
|
||||
else
|
||||
$obj->setSAPBattery($sap);
|
||||
$obj->setSAPBattery(null);
|
||||
|
||||
// validate
|
||||
$errors = $validator->validate($obj);
|
||||
|
|
|
|||
|
|
@ -73,14 +73,14 @@ class Warranty
|
|||
// battery model
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="BatteryModel", inversedBy="warranties")
|
||||
* @ORM\JoinColumn(name="bty_model_id", referencedColumnName="id")
|
||||
* @ORM\JoinColumn(name="bty_model_id", referencedColumnName="id", nullable=true)
|
||||
*/
|
||||
protected $bty_model;
|
||||
|
||||
// battery size
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="BatterySize", inversedBy="warranties")
|
||||
* @ORM\JoinColumn(name="bty_size_id", referencedColumnName="id")
|
||||
* @ORM\JoinColumn(name="bty_size_id", referencedColumnName="id", nullable=true)
|
||||
*/
|
||||
protected $bty_size;
|
||||
|
||||
|
|
@ -371,7 +371,7 @@ class Warranty
|
|||
return $this->mobile_number;
|
||||
}
|
||||
|
||||
public function setBatteryModel(BatteryModel $model)
|
||||
public function setBatteryModel(BatteryModel $model = null)
|
||||
{
|
||||
$this->bty_model = $model;
|
||||
return $this;
|
||||
|
|
@ -382,7 +382,7 @@ class Warranty
|
|||
return $this->bty_model;
|
||||
}
|
||||
|
||||
public function setBatterySize(BatterySize $size)
|
||||
public function setBatterySize(BatterySize $size = null)
|
||||
{
|
||||
$this->bty_size = $size;
|
||||
return $this;
|
||||
|
|
@ -393,7 +393,7 @@ class Warranty
|
|||
return $this->bty_size;
|
||||
}
|
||||
|
||||
public function setSAPBattery(SAPBattery $sap_bty)
|
||||
public function setSAPBattery(SAPBattery $sap_bty = null)
|
||||
{
|
||||
$this->sap_bty = $sap_bty;
|
||||
return $this;
|
||||
|
|
|
|||
|
|
@ -46,9 +46,16 @@ class WarrantySerial
|
|||
*/
|
||||
protected $source;
|
||||
|
||||
// other information
|
||||
/**
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
protected $meta_info;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->date_create = new DateTime();
|
||||
$this->meta_info = [];
|
||||
}
|
||||
|
||||
public function setID($id)
|
||||
|
|
@ -99,4 +106,19 @@ class WarrantySerial
|
|||
{
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
public function addMetaInfo($id, $value)
|
||||
{
|
||||
$this->meta_info[$id] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMetaInfo($id)
|
||||
{
|
||||
// return null if we don't have it
|
||||
if (!isset($this->meta_info[$id]))
|
||||
return null;
|
||||
|
||||
return $this->meta_info[$id];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@
|
|||
SAP Battery
|
||||
</label>
|
||||
<select name="sap_battery" class="form-control m-input">
|
||||
<option value=""></option>
|
||||
{% for sap_battery in sap_batts %}
|
||||
<option value="{{ sap_battery.getID }}"{{ obj.getSAPBattery.getID|default(0) == sap_battery.getID ? ' selected' }}>{{ sap_battery.getID }}</option>
|
||||
{% endfor %}
|
||||
|
|
@ -109,6 +110,7 @@
|
|||
Battery Model
|
||||
</label>
|
||||
<select name="battery_model" class="form-control m-input">
|
||||
<option value=""></option>
|
||||
{% for model in batt_models %}
|
||||
<option value="{{ model.getID }}"{{ obj.getBatteryModel.getID|default(0) == model.getID ? ' selected' }}>{{ model.getName }}</option>
|
||||
{% endfor %}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
// NOTE: reference: https://github.com/Azure/azure-storage-php/blob/master/samples/BlobSamples.php
|
||||
|
||||
require_once(__DIR__ . '/../../vendor/autoload.php');
|
||||
|
||||
use MicrosoftAzure\Storage\Blob\BlobRestProxy;
|
||||
use MicrosoftAzure\Storage\Common\ServiceException;
|
||||
|
||||
//$blob_url = 'https://popappshopprodstorage.blob.core.windows.net/warranty';
|
||||
//$sas_token = 'sp=r&st=2021-03-18T08:26:36Z&se=2021-04-29T16:26:36Z&spr=https&sv=2020-02-10&sr=c&sig=Rwl3aCNThXEzuPjNB9sTvZzsx84ULDylyS1WtPwgyzg%3D';
|
||||
|
||||
|
||||
$blob_url = 'https://popappshopprodstorage.blob.core.windows.net';
|
||||
//$sas_token = 'sp=r&st=2021-03-20T17:09:13Z&se=2021-04-01T01:09:13Z&spr=https&sv=2020-02-10&sr=c&sig=pU2fxj6eXALfGTTrsmaJ7W0QtdstyR88Xs5lvMJ35xQ%3D';
|
||||
|
||||
$sas_token = 'sp=r&st=2021-04-13T03:48:30Z&se=2022-04-01T11:48:30Z&spr=https&sv=2020-02-10&sr=c&sig=L6VDl40qRXhQb7w8JVkj3r7x2Xkt72pQaQ8AH2M5CRk%3D';
|
||||
|
||||
$conn_string = "BlobEndpoint=$blob_url;\nSharedAccessSignature=$sas_token";
|
||||
|
||||
$blob_client = BlobRestProxy::createBlobService($conn_string);
|
||||
|
||||
// get start date from argument: 04-01-21 format
|
||||
$start_date = $argv[1];
|
||||
|
||||
$current_date = new DateTime();
|
||||
|
||||
$end_date = $current_date->format('m-d-y');
|
||||
|
||||
$flag_done_processing = false;
|
||||
$proc_date = $start_date;
|
||||
|
||||
while (!$flag_done_processing) {
|
||||
$filename = 'warrantylogs' . $proc_date . '.csv';
|
||||
echo $filename, PHP_EOL;
|
||||
|
||||
try {
|
||||
// NOTE: via download blob
|
||||
$res = $blob_client->getBlob('warranty', $filename);
|
||||
// print_r($res);
|
||||
|
||||
file_put_contents("/tmp/output.txt", $res->getContentStream(), FILE_APPEND);
|
||||
} catch (Exception $e)
|
||||
{
|
||||
echo 'Caught exception: ', $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
// change proc_date to next day
|
||||
$next_date = DateTime::createFromFormat('m-d-y', $proc_date);
|
||||
$next_date->modify('+1 day');
|
||||
$proc_date = $next_date->format('m-d-y');
|
||||
|
||||
if ($end_date == $proc_date) {
|
||||
$flag_done_processing = true;
|
||||
}
|
||||
}
|
||||
|
||||
52
utils/get_warranty_serial/get_serials.php
Normal file
52
utils/get_warranty_serial/get_serials.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
// NOTE: reference: https://github.com/Azure/azure-storage-php/blob/master/samples/BlobSamples.php
|
||||
|
||||
require_once(__DIR__ . '/../../vendor/autoload.php');
|
||||
|
||||
use MicrosoftAzure\Storage\Blob\BlobRestProxy;
|
||||
use MicrosoftAzure\Storage\Common\ServiceException;
|
||||
|
||||
//$blob_url = 'https://popappshopprodstorage.blob.core.windows.net/warranty';
|
||||
//$sas_token = 'sp=r&st=2021-03-18T08:26:36Z&se=2021-04-29T16:26:36Z&spr=https&sv=2020-02-10&sr=c&sig=Rwl3aCNThXEzuPjNB9sTvZzsx84ULDylyS1WtPwgyzg%3D';
|
||||
|
||||
|
||||
$blob_url = 'https://popappshopprodstorage.blob.core.windows.net';
|
||||
//$sas_token = 'sp=r&st=2021-03-20T17:09:13Z&se=2021-04-01T01:09:13Z&spr=https&sv=2020-02-10&sr=c&sig=pU2fxj6eXALfGTTrsmaJ7W0QtdstyR88Xs5lvMJ35xQ%3D';
|
||||
|
||||
$sas_token = 'sp=r&st=2021-04-13T03:48:30Z&se=2022-04-01T11:48:30Z&spr=https&sv=2020-02-10&sr=c&sig=L6VDl40qRXhQb7w8JVkj3r7x2Xkt72pQaQ8AH2M5CRk%3D';
|
||||
|
||||
$conn_string = "BlobEndpoint=$blob_url;\nSharedAccessSignature=$sas_token";
|
||||
|
||||
$blob_client = BlobRestProxy::createBlobService($conn_string);
|
||||
|
||||
$current_date = new DateTime();
|
||||
$current_date->modify("-1 day");
|
||||
|
||||
$date = $current_date->format('m-d-y');
|
||||
|
||||
$filename = 'warrantylogs' . $date . '.csv';
|
||||
//print_r($filename);
|
||||
|
||||
try {
|
||||
// NOTE: via download blob
|
||||
$res = $blob_client->getBlob('warranty', $filename);
|
||||
// print_r($res);
|
||||
|
||||
file_put_contents("/tmp/output.txt", $res->getContentStream());
|
||||
} catch (Exception $e) {
|
||||
file_put_contents("/tmp/serial_download_error.txt", $filename . "\n" . $e->getMessage() . "\n" . "\n", FILE_APPEND);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
// NOTE: getting via url
|
||||
echo $blob_client->getPsrPrimaryUri() . "\n";
|
||||
|
||||
$url = $blob_client->getPsrPrimaryUri() . '?' . $sas_token;
|
||||
$url = $blob_url . '?' . $sas_token;
|
||||
file_put_contents('output.txt', fopen($url, 'r'));
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ $pass = $argv[4];
|
|||
$db = new PDO($dsn, $user, $pass);
|
||||
|
||||
// prepared statement
|
||||
$sth = $db->prepare('insert into warranty_serial (id, sku, date_create, source) values (:serial, :sku, :date_create, :source)');
|
||||
$sth = $db->prepare('insert into warranty_serial (id, sku, date_create, source, meta_info) values (:serial, :sku, :date_create, :source, :meta_info)');
|
||||
|
||||
|
||||
// go through rows
|
||||
|
|
@ -25,16 +25,41 @@ while (($row = fgetcsv($csv)) !== false)
|
|||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
$serial = trim(strtoupper($row[0]));
|
||||
$sku = trim($row[1]);
|
||||
$date_create = $row[2];
|
||||
$ref_id = $row[3];
|
||||
$ref_id = $row[3]; */
|
||||
|
||||
// sample of line in output file:
|
||||
// serial number, sku, dispatch status, created date, inventory status, category id, category name
|
||||
// CH2000012071,WCHD23BL-CPN00-LX,0,2020-08-11 04:05:27.090,0,4,CHAMPION MF
|
||||
$serial = trim(strtoupper($row[0]));
|
||||
$sku = trim($row[1]);
|
||||
$dispatch_status = trim($row[2]);
|
||||
$date_create = $row[3];
|
||||
$inventory_status = trim($row[4]);
|
||||
$cat_id = trim($row[5]);
|
||||
$cat_name = trim($row[6]);
|
||||
|
||||
$meta_info = [
|
||||
'dispatch_status' => $dispatch_status,
|
||||
'inventory_status' => $inventory_status,
|
||||
'category_id' => $cat_id,
|
||||
'category_name' => $cat_name,
|
||||
];
|
||||
|
||||
$info = json_encode($meta_info);
|
||||
|
||||
if ($sku == 'N/A')
|
||||
$sku = null;
|
||||
|
||||
$res = $sth->execute([
|
||||
':serial' => $serial,
|
||||
':sku' => $sku,
|
||||
':date_create' => $date_create,
|
||||
':source' => $source
|
||||
':source' => $source,
|
||||
':meta_info' => $info,
|
||||
]);
|
||||
|
||||
if (!$res)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,204 @@
|
|||
DispatcheDate,Sku,SerialNumber
|
||||
2020-08-07 05:32:04.537,WMGL23DL-CPNMB-L,MGS706202004
|
||||
2020-08-07 05:32:04.537,WMGL23DL-CPNMB-L,MGS706202005
|
||||
2020-08-07 05:32:04.537,WMGL23DL-CPNMB-L,MGS706202006
|
||||
2020-08-08 09:27:14.480,WMXX26EL-CPN00-LX,MXS808202001
|
||||
2020-08-08 09:31:48.737,WMXX26EL-CPN00-LX,MXS808202002
|
||||
2020-08-08 10:27:08.117,WMXX26EL-CPN00-LX,MXS808202003
|
||||
2020-08-08 10:41:10.060,WMXX26EL-CPN00-LX,MXS808202004
|
||||
2020-08-08 10:41:10.060,WMXX26EL-CPN00-LX,MXS808202005
|
||||
2020-08-08 10:41:10.060,WMXX26EL-CPN00-LX,MXS808202006
|
||||
2020-10-05 13:53:57.000,ECHD26AL-SPN00-LX,CH2000012625
|
||||
PV1000240341,N/A,Dispatch,In,2021-04-12T01:12:16.5930000+08:00
|
||||
PV1000240344,N/A,Dispatch,In,2021-04-12T01:12:16.6100000+08:00
|
||||
PV1000240335,N/A,Dispatch,In,2021-04-12T01:12:16.5630000+08:00
|
||||
PV1000240345,N/A,Dispatch,In,2021-04-12T01:12:16.5930000+08:00
|
||||
PV1000240338,N/A,Dispatch,In,2021-04-12T01:12:16.5930000+08:00
|
||||
PV1000240340,N/A,Dispatch,In,2021-04-12T01:12:16.5930000+08:00
|
||||
PV1000240337,N/A,Dispatch,In,2021-04-12T01:12:16.5770000+08:00
|
||||
PV1000240334,N/A,Dispatch,In,2021-04-12T01:12:16.6100000+08:00
|
||||
PV1000240330,N/A,Dispatch,In,2021-04-12T01:12:16.5630000+08:00
|
||||
PV1000240342,N/A,Dispatch,In,2021-04-12T01:12:16.6100000+08:00
|
||||
PV1000240343,N/A,Dispatch,In,2021-04-12T01:12:16.6100000+08:00
|
||||
PV1000240336,N/A,Dispatch,In,2021-04-12T01:12:16.5630000+08:00
|
||||
PV1000240339,N/A,Dispatch,In,2021-04-12T01:12:16.5470000+08:00
|
||||
PV1000240332,N/A,Dispatch,In,2021-04-12T01:12:16.5770000+08:00
|
||||
PV1000240333,N/A,Dispatch,In,2021-04-12T01:12:16.6100000+08:00
|
||||
PV1000240324,N/A,Dispatch,In,2021-04-12T01:12:16.5770000+08:00
|
||||
PV1000240326,N/A,Dispatch,In,2021-04-12T01:12:16.5770000+08:00
|
||||
MX2000056889,N/A,Dispatch,In,2021-04-12T02:58:37.8900000+08:00
|
||||
MX2000056874,N/A,Dispatch,In,2021-04-12T02:58:37.9070000+08:00
|
||||
MX2000056888,N/A,Dispatch,In,2021-04-12T02:58:37.9070000+08:00
|
||||
MX2000056887,N/A,Dispatch,In,2021-04-12T02:58:37.9070000+08:00
|
||||
MX2000056881,N/A,Dispatch,In,2021-04-12T02:58:37.9070000+08:00
|
||||
MX2000056880,N/A,Dispatch,In,2021-04-12T02:58:37.9230000+08:00
|
||||
MX2000056879,N/A,Dispatch,In,2021-04-12T02:58:37.9370000+08:00
|
||||
MX2000056886,N/A,Dispatch,In,2021-04-12T02:58:37.9370000+08:00
|
||||
MX2000056890,N/A,Dispatch,In,2021-04-12T02:58:37.9370000+08:00
|
||||
MX2000056885,N/A,Dispatch,In,2021-04-12T02:58:37.9370000+08:00
|
||||
MG3102419196,N/A,Dispatch,In,2021-04-12T02:58:38.2200000+08:00
|
||||
MG3102419202,N/A,Dispatch,In,2021-04-12T02:58:38.2330000+08:00
|
||||
MG3102419197,N/A,Dispatch,In,2021-04-12T02:58:38.2330000+08:00
|
||||
MG3102419203,N/A,Dispatch,In,2021-04-12T02:58:38.2200000+08:00
|
||||
MG3102419198,N/A,Dispatch,In,2021-04-12T02:58:38.2200000+08:00
|
||||
PV1000225903,N/A,Dispatch,In,2021-04-11T23:45:21.0630000+08:00
|
||||
PV1000225928,N/A,Dispatch,In,2021-04-11T23:45:21.0500000+08:00
|
||||
PV1000225905,N/A,Dispatch,In,2021-04-11T23:45:20.9870000+08:00
|
||||
PV1000225909,N/A,Dispatch,In,2021-04-11T23:45:21.0330000+08:00
|
||||
PV1000225918,N/A,Dispatch,In,2021-04-11T23:45:21.1900000+08:00
|
||||
PV1000225911,N/A,Dispatch,In,2021-04-11T23:45:21.1100000+08:00
|
||||
PV1000225933,N/A,Dispatch,In,2021-04-11T23:45:21.0170000+08:00
|
||||
PV1000225939,N/A,Dispatch,In,2021-04-11T23:45:21.0500000+08:00
|
||||
PV1000225940,N/A,Dispatch,In,2021-04-11T23:45:21.2030000+08:00
|
||||
PV1000225934,N/A,Dispatch,In,2021-04-11T23:45:21.0500000+08:00
|
||||
PV1000225916,N/A,Dispatch,In,2021-04-11T23:45:21.0630000+08:00
|
||||
PV1000225915,N/A,Dispatch,In,2021-04-11T23:45:21+08:00
|
||||
PV1000225937,N/A,Dispatch,In,2021-04-11T23:45:21+08:00
|
||||
PV1000225929,N/A,Dispatch,In,2021-04-11T23:45:21.0170000+08:00
|
||||
PV1000225906,N/A,Dispatch,In,2021-04-11T23:45:21.1100000+08:00
|
||||
PV1000225938,N/A,Dispatch,In,2021-04-11T23:45:21.0970000+08:00
|
||||
PV1000225902,N/A,Dispatch,In,2021-04-11T23:45:21.0800000+08:00
|
||||
PV1000225914,N/A,Dispatch,In,2021-04-11T23:45:21+08:00
|
||||
PV1000225932,N/A,Dispatch,In,2021-04-11T23:45:21+08:00
|
||||
PV1000225908,N/A,Dispatch,In,2021-04-11T23:45:21.0630000+08:00
|
||||
PV1000225907,N/A,Dispatch,In,2021-04-11T23:45:21.0800000+08:00
|
||||
PV1000225910,N/A,Dispatch,In,2021-04-11T23:45:20.9870000+08:00
|
||||
PV1000225917,N/A,Dispatch,In,2021-04-11T23:45:21.0330000+08:00
|
||||
PV1000225921,N/A,Dispatch,In,2021-04-11T23:45:21.0330000+08:00
|
||||
PV1000225913,N/A,Dispatch,In,2021-04-11T23:45:20.9870000+08:00
|
||||
PV1000225919,N/A,Dispatch,In,2021-04-11T23:45:21.0800000+08:00
|
||||
PV1000225935,N/A,Dispatch,In,2021-04-11T23:45:21.0970000+08:00
|
||||
PV1000225900,N/A,Dispatch,In,2021-04-11T23:45:21.0330000+08:00
|
||||
PV1000225904,N/A,Dispatch,In,2021-04-11T23:45:21.1100000+08:00
|
||||
PV1000225931,N/A,Dispatch,In,2021-04-11T23:45:21.0970000+08:00
|
||||
PV1000225897,N/A,Dispatch,In,2021-04-11T23:45:21.0800000+08:00
|
||||
PV1000225901,N/A,Dispatch,In,2021-04-11T23:45:20.9870000+08:00
|
||||
PV1000225930,N/A,Dispatch,In,2021-04-11T23:45:21.2030000+08:00
|
||||
PV1000225926,N/A,Dispatch,In,2021-04-11T23:45:21.1900000+08:00
|
||||
PV1000225898,N/A,Dispatch,In,2021-04-11T23:45:21.0630000+08:00
|
||||
PV1000225927,N/A,Dispatch,In,2021-04-11T23:45:21.0970000+08:00
|
||||
PV1000225896,N/A,Dispatch,In,2021-04-11T23:45:21.0330000+08:00
|
||||
PV1000225924,N/A,Dispatch,In,2021-04-11T23:45:21.0500000+08:00
|
||||
PV1000225983,N/A,Dispatch,In,2021-04-11T23:45:20.9700000+08:00
|
||||
PV1000225925,N/A,Dispatch,In,2021-04-11T23:45:21.0170000+08:00
|
||||
PV1000225985,N/A,Dispatch,In,2021-04-11T23:45:20.9700000+08:00
|
||||
PV1000225912,N/A,Dispatch,In,2021-04-11T23:45:20.9870000+08:00
|
||||
PV1000225980,N/A,Dispatch,In,2021-04-11T23:45:20.9700000+08:00
|
||||
PV1000225982,N/A,Dispatch,In,2021-04-11T23:45:20.9700000+08:00
|
||||
PV1000225922,N/A,Dispatch,In,2021-04-11T23:45:21.1900000+08:00
|
||||
PV1000225923,N/A,Dispatch,In,2021-04-11T23:45:21.0800000+08:00
|
||||
PV1000225984,N/A,Dispatch,In,2021-04-11T23:45:20.9700000+08:00
|
||||
PV1000225899,N/A,Dispatch,In,2021-04-11T23:45:20.9870000+08:00
|
||||
PV1000225920,N/A,Dispatch,In,2021-04-11T23:45:21.0500000+08:00
|
||||
MES215591711,N/A,Dispatch,In,2021-04-11T22:36:43.9830000+08:00
|
||||
MES215591707,N/A,Dispatch,In,2021-04-11T22:36:43.9670000+08:00
|
||||
MES215591708,N/A,Dispatch,In,2021-04-11T22:36:43.9830000+08:00
|
||||
MES215591699,N/A,Dispatch,In,2021-04-11T22:36:43.8600000+08:00
|
||||
MES215591700,N/A,Dispatch,In,2021-04-11T22:36:43.8430000+08:00
|
||||
MES215591718,N/A,Dispatch,In,2021-04-11T22:36:44.0770000+08:00
|
||||
MES215591733,N/A,Dispatch,In,2021-04-11T22:36:44.0770000+08:00
|
||||
MES215591725,N/A,Dispatch,In,2021-04-11T22:36:44.0600000+08:00
|
||||
MES215591723,N/A,Dispatch,In,2021-04-11T22:36:44.0930000+08:00
|
||||
MES215591724,N/A,Dispatch,In,2021-04-11T22:36:44.0930000+08:00
|
||||
MES215591712,N/A,Dispatch,In,2021-04-11T22:36:44.0130000+08:00
|
||||
MES215591716,N/A,Dispatch,In,2021-04-11T22:36:44.0300000+08:00
|
||||
MES215591713,N/A,Dispatch,In,2021-04-11T22:36:44.0130000+08:00
|
||||
MES215591714,N/A,Dispatch,In,2021-04-11T22:36:44.0300000+08:00
|
||||
MES215591719,N/A,Dispatch,In,2021-04-11T22:36:44.0130000+08:00
|
||||
MES215591721,N/A,Dispatch,In,2021-04-11T22:36:44.0300000+08:00
|
||||
MES215591720,N/A,Dispatch,In,2021-04-11T22:36:44.0300000+08:00
|
||||
MES215591722,N/A,Dispatch,In,2021-04-11T22:36:44.0470000+08:00
|
||||
MES215591715,N/A,Dispatch,In,2021-04-11T22:36:44.0470000+08:00
|
||||
MES215591709,N/A,Dispatch,In,2021-04-11T22:36:44+08:00
|
||||
MES215591710,N/A,Dispatch,In,2021-04-11T22:36:44+08:00
|
||||
MES215591704,N/A,Dispatch,In,2021-04-11T22:36:43.9670000+08:00
|
||||
MES215591706,N/A,Dispatch,In,2021-04-11T22:36:43.9830000+08:00
|
||||
MES215591698,N/A,Dispatch,In,2021-04-11T22:36:43.8430000+08:00
|
||||
MES215591705,N/A,Dispatch,In,2021-04-11T22:36:43.8600000+08:00
|
||||
MES215591732,N/A,Dispatch,In,2021-04-11T22:36:44.0770000+08:00
|
||||
MES215591731,N/A,Dispatch,In,2021-04-11T22:36:44.0770000+08:00
|
||||
MES215591717,N/A,Dispatch,In,2021-04-11T22:36:44.0470000+08:00
|
||||
MES215591727,N/A,Dispatch,In,2021-04-11T22:36:44.0470000+08:00
|
||||
MES215591695,N/A,Dispatch,In,2021-04-11T22:36:43.9530000+08:00
|
||||
MES215591701,N/A,Dispatch,In,2021-04-11T22:36:44+08:00
|
||||
MES215591702,N/A,Dispatch,In,2021-04-11T22:36:44+08:00
|
||||
MES215591689,N/A,Dispatch,In,2021-04-11T22:36:43.8430000+08:00
|
||||
MES215591692,N/A,Dispatch,In,2021-04-11T22:36:43.8600000+08:00
|
||||
MES215591696,N/A,Dispatch,In,2021-04-11T22:36:43.9670000+08:00
|
||||
MES215591697,N/A,Dispatch,In,2021-04-11T22:36:43.9670000+08:00
|
||||
MES215591703,N/A,Dispatch,In,2021-04-11T22:36:44+08:00
|
||||
MES215591690,N/A,Dispatch,In,2021-04-11T22:36:43.8430000+08:00
|
||||
MES215591693,N/A,Dispatch,In,2021-04-11T22:36:43.8600000+08:00
|
||||
MES215591681,N/A,Dispatch,In,2021-04-11T22:36:43.8270000+08:00
|
||||
MES215591683,N/A,Dispatch,In,2021-04-11T22:36:43.9530000+08:00
|
||||
MES215591687,N/A,Dispatch,In,2021-04-11T22:36:43.9530000+08:00
|
||||
MES215591686,N/A,Dispatch,In,2021-04-11T22:36:43.9530000+08:00
|
||||
MES215591688,N/A,Dispatch,In,2021-04-11T22:36:44.0130000+08:00
|
||||
MES215591685,N/A,Dispatch,In,2021-04-11T22:36:43.8730000+08:00
|
||||
MES215591682,N/A,Dispatch,In,2021-04-11T22:36:43.8270000+08:00
|
||||
MES215591684,N/A,Dispatch,In,2021-04-11T22:36:43.8430000+08:00
|
||||
MES215591691,N/A,Dispatch,In,2021-04-11T22:36:43.8600000+08:00
|
||||
MES215591694,N/A,Dispatch,In,2021-04-11T22:36:43.9670000+08:00
|
||||
MG3101407704,N/A,Dispatch,In,2021-04-12T00:39:47.1870000+08:00
|
||||
MG3101407702,N/A,Dispatch,In,2021-04-12T00:39:47.1870000+08:00
|
||||
MG3101407703,N/A,Dispatch,In,2021-04-12T00:39:47.1870000+08:00
|
||||
MG3101407701,N/A,Dispatch,In,2021-04-12T00:39:47.1870000+08:00
|
||||
MG3101407705,N/A,Dispatch,In,2021-04-12T00:39:47.1700000+08:00
|
||||
MG2000112754,N/A,Dispatch,In,2021-04-12T00:40:11.3670000+08:00
|
||||
MX2000067982,N/A,Dispatch,In,2021-04-12T00:33:42.1830000+08:00
|
||||
MX2000067975,N/A,Dispatch,In,2021-04-12T00:33:42.4670000+08:00
|
||||
MX2000067983,N/A,Dispatch,In,2021-04-12T00:33:42.1830000+08:00
|
||||
MX2000067979,N/A,Dispatch,In,2021-04-12T00:33:42.4500000+08:00
|
||||
MX2000067984,N/A,Dispatch,In,2021-04-12T00:33:42.1700000+08:00
|
||||
MX2000067972,N/A,Dispatch,In,2021-04-12T00:33:42.3730000+08:00
|
||||
MX2000067971,N/A,Dispatch,In,2021-04-12T00:33:42.4330000+08:00
|
||||
MX2000067977,N/A,Dispatch,In,2021-04-12T00:33:42.4500000+08:00
|
||||
MX2000067981,N/A,Dispatch,In,2021-04-12T00:33:42.4670000+08:00
|
||||
MX2000067974,N/A,Dispatch,In,2021-04-12T00:33:42.4500000+08:00
|
||||
MX2000067978,N/A,Dispatch,In,2021-04-12T00:33:42.4670000+08:00
|
||||
MX2000067989,N/A,Dispatch,In,2021-04-12T00:33:42.1700000+08:00
|
||||
MX2000067980,N/A,Dispatch,In,2021-04-12T00:33:42.1830000+08:00
|
||||
MX2000067976,N/A,Dispatch,In,2021-04-12T00:33:42.1830000+08:00
|
||||
MX2000067973,N/A,Dispatch,In,2021-04-12T00:33:42.2170000+08:00
|
||||
MX2000067985,N/A,Dispatch,In,2021-04-12T00:33:42.1530000+08:00
|
||||
MX2000067990,N/A,Dispatch,In,2021-04-12T00:33:42.1700000+08:00
|
||||
MX2000067987,N/A,Dispatch,In,2021-04-12T00:33:42.1700000+08:00
|
||||
MX2000067992,N/A,Dispatch,In,2021-04-12T00:33:42.5270000+08:00
|
||||
MX2000067988,N/A,Dispatch,In,2021-04-12T00:33:41.9330000+08:00
|
||||
MX2000067986,N/A,Dispatch,In,2021-04-12T00:33:42.1700000+08:00
|
||||
MX2000068005,N/A,Dispatch,In,2021-04-12T00:33:42.4800000+08:00
|
||||
MX2000068006,N/A,Dispatch,In,2021-04-12T00:33:42.4800000+08:00
|
||||
MX2000068010,N/A,Dispatch,In,2021-04-12T00:33:42.4970000+08:00
|
||||
MX2000067994,N/A,Dispatch,In,2021-04-12T00:33:42.8570000+08:00
|
||||
MX2000067991,N/A,Dispatch,In,2021-04-12T00:33:42.5270000+08:00
|
||||
MX2000067995,N/A,Dispatch,In,2021-04-12T00:33:42.5130000+08:00
|
||||
MX2000067997,N/A,Dispatch,In,2021-04-12T00:33:42.5270000+08:00
|
||||
MX2000067999,N/A,Dispatch,In,2021-04-12T00:33:42.5730000+08:00
|
||||
MX2000068003,N/A,Dispatch,In,2021-04-12T00:33:42.5130000+08:00
|
||||
MX2000068015,N/A,Dispatch,In,2021-04-12T00:33:42.9500000+08:00
|
||||
MX2000068020,N/A,Dispatch,In,2021-04-12T00:33:42.9500000+08:00
|
||||
MX2000068028,N/A,Dispatch,In,2021-04-12T00:33:42.9030000+08:00
|
||||
MX2000068024,N/A,Dispatch,In,2021-04-12T00:33:42.9330000+08:00
|
||||
MX2000068029,N/A,Dispatch,In,2021-04-12T00:33:42.9200000+08:00
|
||||
MX2000068026,N/A,Dispatch,In,2021-04-12T00:33:42.9200000+08:00
|
||||
MX2000068023,N/A,Dispatch,In,2021-04-12T00:33:42.9330000+08:00
|
||||
MX2000068019,N/A,Dispatch,In,2021-04-12T00:33:42.9800000+08:00
|
||||
MX2000068018,N/A,Dispatch,In,2021-04-12T00:33:42.9800000+08:00
|
||||
MX2000068014,N/A,Dispatch,In,2021-04-12T00:33:42.9800000+08:00
|
||||
MX2000068022,N/A,Dispatch,In,2021-04-12T00:33:42.9330000+08:00
|
||||
MX2000068017,N/A,Dispatch,In,2021-04-12T00:33:42.9670000+08:00
|
||||
MX2000068011,N/A,Dispatch,In,2021-04-12T00:33:42.9500000+08:00
|
||||
MX2000068012,N/A,Dispatch,In,2021-04-12T00:33:42.9670000+08:00
|
||||
MX2000068008,N/A,Dispatch,In,2021-04-12T00:33:42.4800000+08:00
|
||||
MX2000068009,N/A,Dispatch,In,2021-04-12T00:33:42.4800000+08:00
|
||||
MX2000068004,N/A,Dispatch,In,2021-04-12T00:33:42.4970000+08:00
|
||||
MX2000067993,N/A,Dispatch,In,2021-04-12T00:33:42.5430000+08:00
|
||||
MX2000068016,N/A,Dispatch,In,2021-04-12T00:33:42.9670000+08:00
|
||||
MX2000068013,N/A,Dispatch,In,2021-04-12T00:33:42.9670000+08:00
|
||||
MX2000068025,N/A,Dispatch,In,2021-04-12T00:33:42.9030000+08:00
|
||||
MX2000068021,N/A,Dispatch,In,2021-04-12T00:33:42.9500000+08:00
|
||||
MX2000068007,N/A,Dispatch,In,2021-04-12T00:33:42.4970000+08:00
|
||||
MX2000068002,N/A,Dispatch,In,2021-04-12T00:33:42.5130000+08:00
|
||||
MX2000068000,N/A,Dispatch,In,2021-04-12T00:33:42.5600000+08:00
|
||||
MX2000067998,N/A,Dispatch,In,2021-04-12T00:33:42.5270000+08:00
|
||||
MX2000068001,N/A,Dispatch,In,2021-04-12T00:33:42.5130000+08:00
|
||||
MX2000067996,N/A,Dispatch,In,2021-04-12T00:33:42.5130000+08:00
|
||||
MX2000067967,N/A,Dispatch,In,2021-04-12T00:33:42.9030000+08:00
|
||||
MX2000067969,N/A,Dispatch,In,2021-04-12T00:33:42.8870000+08:00
|
||||
MX2000067968,N/A,Dispatch,In,2021-04-12T00:33:42.8570000+08:00
|
||||
MX2000067970,N/A,Dispatch,In,2021-04-12T00:33:42.8870000+08:00
|
||||
MX2000067965,N/A,Dispatch,In,2021-04-12T00:33:42.8730000+08:00
|
||||
MX2000067966,N/A,Dispatch,In,2021-04-12T00:33:42.8870000+08:00
|
||||
MX2000067964,N/A,Dispatch,In,2021-04-12T00:33:42.8870000+08:00
|
||||
MX2000067963,N/A,Dispatch,In,2021-04-12T00:33:42.9030000+08:00
|
||||
MX2000068030,N/A,Dispatch,In,2021-04-12T00:33:42.9200000+08:00
|
||||
MX2000068027,N/A,Dispatch,In,2021-04-12T00:33:42.9200000+08:00
|
||||
|
|
|
|||
|
|
@ -7,20 +7,29 @@ require_once(__DIR__ . '/../../vendor/autoload.php');
|
|||
use MicrosoftAzure\Storage\Blob\BlobRestProxy;
|
||||
use MicrosoftAzure\Storage\Common\ServiceException;
|
||||
|
||||
$blob_url = 'https://popappshopprodstorage.blob.core.windows.net/warranty';
|
||||
$sas_token = 'sp=r&st=2021-03-18T08:26:36Z&se=2021-04-29T16:26:36Z&spr=https&sv=2020-02-10&sr=c&sig=Rwl3aCNThXEzuPjNB9sTvZzsx84ULDylyS1WtPwgyzg%3D';
|
||||
//$blob_url = 'https://popappshopprodstorage.blob.core.windows.net/warranty';
|
||||
//$sas_token = 'sp=r&st=2021-03-18T08:26:36Z&se=2021-04-29T16:26:36Z&spr=https&sv=2020-02-10&sr=c&sig=Rwl3aCNThXEzuPjNB9sTvZzsx84ULDylyS1WtPwgyzg%3D';
|
||||
|
||||
|
||||
$blob_url = 'https://popappshopprodstorage.blob.core.windows.net';
|
||||
$sas_token = 'sp=r&st=2021-03-20T17:09:13Z&se=2021-04-01T01:09:13Z&spr=https&sv=2020-02-10&sr=c&sig=pU2fxj6eXALfGTTrsmaJ7W0QtdstyR88Xs5lvMJ35xQ%3D';
|
||||
//$sas_token = 'sp=r&st=2021-03-20T17:09:13Z&se=2021-04-01T01:09:13Z&spr=https&sv=2020-02-10&sr=c&sig=pU2fxj6eXALfGTTrsmaJ7W0QtdstyR88Xs5lvMJ35xQ%3D';
|
||||
|
||||
$sas_token = 'sp=r&st=2021-04-13T03:48:30Z&se=2022-04-01T11:48:30Z&spr=https&sv=2020-02-10&sr=c&sig=L6VDl40qRXhQb7w8JVkj3r7x2Xkt72pQaQ8AH2M5CRk%3D';
|
||||
|
||||
$conn_string = "BlobEndpoint=$blob_url;\nSharedAccessSignature=$sas_token";
|
||||
|
||||
$blob_client = BlobRestProxy::createBlobService($conn_string);
|
||||
|
||||
$current_date = new DateTime();
|
||||
$current_date->modify("-1 day");
|
||||
|
||||
$date = $current_date->format('m-d-Y');
|
||||
|
||||
$filename = 'warrantylogs' . $date . '.csv';
|
||||
//print_r($filename);
|
||||
|
||||
// NOTE: via download blob
|
||||
$res = $blob_client->getBlob('warranty', 'Sample Result.csv');
|
||||
$res = $blob_client->getBlob('warranty', $filename);
|
||||
// print_r($res);
|
||||
|
||||
file_put_contents("output.txt", $res->getContentStream());
|
||||
|
|
|
|||
Loading…
Reference in a new issue