本文整理汇总了PHP中Prefs::getDeliveryId方法的典型用法代码示例。如果您正苦于以下问题:PHP Prefs::getDeliveryId方法的具体用法?PHP Prefs::getDeliveryId怎么用?PHP Prefs::getDeliveryId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prefs
的用法示例。
在下文中一共展示了Prefs::getDeliveryId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beforeImportCommit
public function beforeImportCommit($data)
{
date_default_timezone_set('Asia/Jakarta');
/*
unset($data['createdDate']);
unset($data['lastUpdate']);
$data['created'] = $data['created_at'];
unset($data['created_at']);
unset($data['updated_at']);
*/
$trav = $this->traverseFields(Config::get('jex.default_export_fields'));
foreach ($data as $key => $value) {
if (array_key_exists($key, $trav)) {
if ($trav[$key]['kind'] == 'text') {
$data[$key] = strval($value);
}
if ($trav[$key]['kind'] == 'daterange' || $trav[$key]['kind'] == 'datetimerange' || $trav[$key]['kind'] == 'date' || $trav[$key]['kind'] == 'datetime') {
if ($key != 'createdDate' && $key != 'lastUpdate') {
$data[$key] = new MongoDate(strtotime($data[$key]));
}
}
}
}
/*
$data['CONSIGNEE_OLSHOP_CUST'] = strval($data['CONSIGNEE_OLSHOP_CUST']);
$data['CONSIGNEE_OLSHOP_ORDERID'] = strval($data['CONSIGNEE_OLSHOP_ORDERID']);
$data['CONSIGNEE_OLSHOP_PHONE'] = strval($data['CONSIGNEE_OLSHOP_PHONE']);
$data['CONSIGNEE_OLSHOP_ZIP'] = strval($data['CONSIGNEE_OLSHOP_ZIP']);
$data['NO_SALES_ORDER'] = strval($data['NO_SALES_ORDER']);
*/
//$data['PICK_UP_DATE'] = new MongoDate( strtotime($data['PICK_UP_DATE']) );
if (isset($data['consignee_olshop_cust'])) {
$logistic = Logistic::where('consignee_olshop_cust', '=', $data['consignee_olshop_cust'])->first();
if ($logistic) {
$data['logistic'] = $logistic->logistic_code;
$data['logistic_type'] = $logistic->type;
} else {
$data['logistic'] = 'BEST001';
$data['logistic_type'] = 'internal';
}
}
if (isset($data['consignee_olshop_province'])) {
} else {
$data['consignee_olshop_province'] = '';
}
$data['delivery_type'] = isset($data['delivery_type']) ? $data['delivery_type'] : 'REG';
$data['trip'] = isset($data['trip']) ? intval($data['trip']) : 1;
$data['awb'] = isset($data['awb']) ? trim($data['awb']) : '';
if (isset($data['cod'])) {
if ($data['cod'] == '' || is_null($data['cod'])) {
//print 'cod is null';
$data['cod'] = 0;
}
$data['cod'] = doubleval($data['cod']);
$data['cod'] = floor($data['cod'] * 100) / 100;
}
$data['bucket'] = Config::get('jayon.bucket_incoming');
$data['delivery_id'] = Prefs::getDeliveryId();
$data['order_id'] = $data['no_sales_order'];
$data['fulfillment_code'] = $data['consignee_olshop_orderid'];
// for AWB update
if (isset($data['number_of_package'])) {
$this->updateBox($data['delivery_id'], $data['order_id'], $data['fulfillment_code'], $data['number_of_package'], $data['position']);
}
$data['status'] = Config::get('jayon.trans_status_confirmed');
$data['logistic_status'] = '';
$data['pending_count'] = 0;
$data['courier_status'] = Config::get('jayon.trans_cr_atmerchant');
$data['warehouse_status'] = Config::get('jayon.trans_wh_atmerchant');
$data['pickup_status'] = Config::get('jayon.trans_status_tobepickup');
$data['device_key'] = '';
$data['device_name'] = '';
$data['device_id'] = '';
$data['courier_name'] = '';
$data['courier_id'] = '';
$data['uploaded'] = 0;
unset($data['volume']);
unset($data['sessId']);
unset($data['isHead']);
return $data;
}