当前位置: 首页>>代码示例>>PHP>>正文


PHP Prefs::get_weight_tariff方法代码示例

本文整理汇总了PHP中Prefs::get_weight_tariff方法的典型用法代码示例。如果您正苦于以下问题:PHP Prefs::get_weight_tariff方法的具体用法?PHP Prefs::get_weight_tariff怎么用?PHP Prefs::get_weight_tariff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Prefs的用法示例。


在下文中一共展示了Prefs::get_weight_tariff方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $key = Input::get('key');
     $json = Input::all();
     //print_r($json);
     /*
                         ->join('members as m','d.merchant_id=m.id','left')
                         ->where('assignment_date',$indate)
                         ->where('device_id',$dev->id)
                         ->and_()
                         ->group_start()
                             ->where('status',$this->config->item('trans_status_admin_courierassigned'))
                             ->or_()
                             ->group_start()
                                 ->where('status',$this->config->item('trans_status_new'))
                                 ->where('pending_count >', 0)
                             ->group_end()
                         ->group_end()
     */
     if (is_null($key) || $key == '') {
         $actor = 'no id : no name';
         \Event::fire('log.api', array($this->controller_name, 'post', $actor, 'empty key'));
         return \Response::json(array('status' => 'ERR:EMPTYKEY', 'timestamp' => time(), 'message' => 'Empty Key'));
     }
     $app = \Application::where('key', '=', $key)->first();
     if ($app) {
         $jsons = Input::json();
         $model = new \Shipment();
         $merchant_id = $app->merchant_id;
         $app_id = $app->id;
         $app_key = $app->key;
         $result = array();
         /*
         foreach ($jsons as $json) {
         
             $order = $this->ordermap;
         
             print_r($json);
         
         }
         
         die();
         */
         foreach ($jsons as $json) {
             //print_r($json);
             $order = $this->ordermap;
             if (isset($json['pick_up_date'])) {
                 if (is_array($json['pick_up_date']) && isset($json['pick_up_date']['sec'])) {
                     $pick_up_date = date('Y-m-d H:i:s', $json['pick_up_date']['sec']);
                 } else {
                     $pick_up_date = $json['pick_up_date'];
                 }
             } else {
                 $pick_up_date = date('Y-m-d H:i:s', time());
             }
             $codval = doubleval($json['cod']);
             //$codval = floor($codval * 100) / 100;
             $codval = round($codval, 0, PHP_ROUND_HALF_UP);
             $order['buyerdeliveryzone'] = isset($json['district']) ? $json['district'] : '';
             $order['merchant_trans_id'] = $json['no_sales_order'];
             $order['buyerdeliverytime'] = $pick_up_date;
             $order['fulfillment_code'] = $json['consignee_olshop_orderid'];
             $order['box_count'] = $json['number_of_package'];
             $order['delivery_type'] = trim($json['delivery_type']);
             $order['total_price'] = $codval;
             $order['email'] = $json['email'];
             $order['buyer_name'] = $json['consignee_olshop_name'];
             $order['recipient_name'] = $json['consignee_olshop_name'];
             $order['shipping_address'] = $json['consignee_olshop_addr'];
             $order['buyerdeliverycity'] = $json['consignee_olshop_city'];
             $order['shipping_zip'] = $json['consignee_olshop_zip'];
             $order['phone'] = $json['consignee_olshop_phone'];
             $order['delivery_bearer'] = 'merchant';
             $order['cod_bearer'] = 'merchant';
             $order['actual_weight'] = strval($json['w_v']);
             $weight = $json['w_v'];
             $delivery_type = trim($json['delivery_type']);
             $order['weight'] = \Prefs::get_weight_tariff($weight, $delivery_type, $app_id);
             $order['merchant_id'] = $merchant_id;
             $order['application_id'] = $app_id;
             $order['application_key'] = $app_key;
             $trx_detail = array();
             $trx_detail[0]['unit_description'] = $json['consignee_olshop_desc'];
             $trx_detail[0]['unit_price'] = $json['cod'];
             $trx_detail[0]['unit_quantity'] = 1;
             $trx_detail[0]['unit_total'] = $json['cod'];
             $trx_detail[0]['unit_discount'] = 0;
             $order['trx_detail'] = $trx_detail;
             $trx_id = $order['merchant_trans_id'];
             $trx = json_encode($order);
             $order['merchant_trans_id'] = $json['no_sales_order'];
             $order['fulfillment_code'] = $json['consignee_olshop_orderid'];
             $inlog = $json;
             $inlog['ts'] = new \MongoDate();
             unset($inlog['_id']);
//.........这里部分代码省略.........
开发者ID:awidarto,项目名称:jexadmin,代码行数:101,代码来源:AwbController.php


注:本文中的Prefs::get_weight_tariff方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。