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


PHP get_current_time函数代码示例

本文整理汇总了PHP中get_current_time函数的典型用法代码示例。如果您正苦于以下问题:PHP get_current_time函数的具体用法?PHP get_current_time怎么用?PHP get_current_time使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: import_orders

 public function import_orders()
 {
     if (strpos($_SERVER['SCRIPT_FILENAME'], 'solr_auto_import_orders.php') === FALSE) {
         exit;
     }
     $end_time = date('Y-m-d H:i:s');
     set_time_limit(0);
     $limit = 1000;
     $end_time = get_current_time();
     $offset = 0;
     $order_table = 'order_list_completed';
     $order_id = 'order_id';
     $start_time = $this->solr_order_model->fetch_solr_order_updated_date();
     $start_time = date('Y-m-d H:i:s', mktime(substr($start_time, 11, 2), substr($start_time, 14, 2), substr($start_time, 17, 2), substr($start_time, 5, 2), substr($start_time, 8, 2) - 45, substr($start_time, 0, 4)));
     echo $start_time;
     $successful = TRUE;
     $successful1 = TRUE;
     //$this->_process_import_order($order_table, $order_id, $start_time, $end_time, $limit, $offset);
     $offset = 0;
     $order_table = 'order_list';
     $order_id = 'id';
     $successful2 = $this->_process_import_order($order_table, $order_id, $start_time, $end_time, $limit, $offset);
     if ($successful1 && $successful2) {
         $this->solr_order_model->update_solr_order_updated_date($end_time);
     }
 }
开发者ID:ohjack,项目名称:mallerp_standard,代码行数:26,代码来源:solr_order_auto.php

示例2: _proccess_track_ebay_competitor

 private function _proccess_track_ebay_competitor($id)
 {
     $ebay_url_base = 'http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=';
     $competitor = $this->ebay_model->fetch_competitor_by_id($id);
     $item_id = $competitor->item_id;
     //$item_id = 270801805639;
     $ebay_item = $this->ebay_model->fetch_ebay_item_by_item_id($item_id);
     if ($ebay_item->currency == 'EUR') {
         $ebay_url_base = 'http://www.ebay.de/itm/ws/eBayISAPI.dll?ViewItem&item=';
     }
     if ($ebay_item->currency == 'GBP') {
         $ebay_url_base = 'http://www.ebay.co.uk/itm/ws/eBayISAPI.dll?ViewItem&item=';
     }
     if ($ebay_item->currency == 'AUD') {
         $ebay_url_base = 'http://www.ebay.com.au/itm/ws/eBayISAPI.dll?ViewItem&item=';
     }
     if (empty($ebay_item)) {
         //$this->ebay_model->drop_competitor_by_item_id($item_id);
         return;
     }
     $competitor_result = fetch_ebay_competitor_price($competitor->url);
     if (empty($competitor_result)) {
         return;
     }
     $our_result = fetch_ebay_competitor_price($ebay_url_base . $ebay_item->item_id);
     if (empty($our_result)) {
         return;
     }
     //var_dump($our_result);die();
     $price = $competitor_result['total'];
     $our_price = $our_result['total'] + $competitor->allowed_difference;
     if ($our_price > $price) {
         $balance = $price - $our_price;
         $status = 1;
     } else {
         $balance = '+' . ($price - $our_price);
         $status = 0;
     }
     $competitor_data = array('balance' => $balance, 'status' => $status, 'track_time' => get_current_time());
     $this->ebay_model->update_competitor($competitor->id, $competitor_data);
     var_dump($competitor_data);
     /*
      * warn our saler
      */
     if ($status && $ebay_item->alarm != 1) {
         $this->ebay_model->update_ebay_by_item_id($item_id, array('alarm' => 1));
     }
     /**
      * update our item price.
      **/
     $this->ebay_model->update_ebay_by_item_id($item_id, array('price' => $our_result['product'], 'shipping_price' => $our_result['shipping']));
     if ($status) {
         $click_url = $competitor->url;
         $saler_ids = $this->ebay_model->fetch_saler_ids_by_ebay_id($ebay_item->ebay_id);
         var_dump($saler_ids);
         $this->events->trigger('ebay_item_price_too_high', array('type' => 'ebay_item_price_too_high_notify', 'click_url' => $click_url, 'content' => sprintf(lang('competitor_has_lower_price'), $competitor->seller_id), 'owner_id' => 0, 'allowed_user_ids' => $saler_ids));
     }
 }
开发者ID:ohjack,项目名称:mallerp_standard,代码行数:58,代码来源:auto_ebay.php

示例3: start_execution

function start_execution()
{
    $unix = new unix();
    BuildingExecRightStatus("Building postfix status...", 20);
    postfix_status();
    BuildingExecRightStatus("Building postfix status...", 55);
    events("postfix_status() OK");
    get_current_time();
    events("get_current_time() OK");
    BuildingExecRightStatus("Building postfix status...", 90);
    BuildingExecRightStatus("done...", 100);
}
开发者ID:brucewu16899,项目名称:artica,代码行数:12,代码来源:exec.admin.smtp.flow.status.php

示例4: add_new_template

 public function add_new_template()
 {
     $user_id = get_current_user_id();
     $created_date = get_current_time();
     $data = array('template_name' => '[edit]', 'template_content' => '[edit]', 'user' => $user_id, 'template_subject' => '[edit]', 'created_date ' => $created_date);
     try {
         $this->ebay_model->add_ebay_message_template($data);
         echo $this->create_json(1, lang('configuration_accepted'));
     } catch (Exception $e) {
         $this->ajax_failed();
         echo lang('error_msg');
     }
 }
开发者ID:ohjack,项目名称:mallerp_standard,代码行数:13,代码来源:ebay_message.php

示例5: add_new_email_template

 public function add_new_email_template()
 {
     $user_id = get_current_user_id();
     $update_time = get_current_time();
     $name = get_current_user_name();
     $created_date = get_current_time();
     $remark = $name . lang('on') . $update_time . lang('create_template') . "<br>";
     $data = array('title' => '', 'content' => '', 'code' => '', 'creator' => $user_id, 'remark' => $remark, 'created_date ' => $created_date);
     try {
         $this->edm_email_model->add_edm_email($data);
         echo $this->create_json(1, lang('configuration_accepted'));
     } catch (Exception $e) {
         $this->ajax_failed();
         echo lang('error_msg');
     }
 }
开发者ID:ohjack,项目名称:mallerp_standard,代码行数:16,代码来源:email_marketing.php

示例6: move_save

 public function move_save()
 {
     if ($this->input->is_post()) {
         $ship_order_no = $this->input->post('ship_order_no');
         $log_type = $this->input->post('log_type');
         $storage_code = $this->input->post('storage_code');
         $ship_confirm_date = $this->input->post('ship_confirm_date');
         $locale = $this->input->post('locale');
         $collect_address = $this->input->post('collect_address');
         $ship_confirm_user = $this->input->post('ship_confirm_user');
         $transaction_number = $this->input->post('transaction_number');
         $abroad_stock_remark = $this->input->post('abroad_stock_remark');
         $sku_arr = $this->input->post('sku');
         $qty_arr = $this->input->post('qty');
     }
     $sku_str = '';
     $qty_str = '';
     foreach ($sku_arr as $val => $sku) {
         if (!$this->product_model->check_exists('product_basic', array('sku' => $sku))) {
             echo $this->create_json(0, lang('product_sku_nonentity'));
             return;
         } else {
             $sku_str = $sku_str . $sku . ',';
         }
     }
     foreach ($qty_arr as $qty) {
         if (!is_positive($qty)) {
             echo $this->create_json(0, lang('qty_not_natural'));
             return;
         } else {
             $qty_str = $qty_str . $qty . ',';
         }
     }
     $sku_str = substr($sku_str, 0, strlen($sku_str) - 1);
     $qty_str = substr($qty_str, 0, strlen($qty_str) - 1);
     $creator = $this->get_current_login_name();
     $created_date = get_current_time();
     $data = array('ship_order_no' => $ship_order_no, 'log_type' => $log_type, 'storage_code' => $storage_code, 'ship_confirm_date' => $ship_confirm_date, 'locale' => $locale, 'remark' => $abroad_stock_remark, 'collect_address' => $collect_address, 'ship_confirm_user' => $ship_confirm_user, 'transaction_number' => $transaction_number, 'sku_str' => $sku_str, 'qty_str' => $qty_str, 'creator' => $creator, 'created_date' => $created_date);
     $this->product_model->save_move_stock($data);
     foreach ($sku_arr as $val => $sku) {
         $count = $qty_arr[$val];
         $this->change_stock_count($sku, $storage_code, $count);
     }
     echo $this->create_json(1, lang('purchase_apply_saved'));
 }
开发者ID:ohjack,项目名称:mallerp_standard,代码行数:45,代码来源:move_stock.php

示例7: trade_get

 public function trade_get()
 {
     $now = get_current_time();
     $top_client = get_top_client();
     $tids = $this->taobao_model->get_order_tid();
     foreach ($tids as $tid) {
         $tid = $tid->tid;
         $req = new TradeGetRequest();
         $req->setFields("tid, status");
         $req->setTid($tid);
         try {
             $resp = $top_client->execute($req);
         } catch (Exception $e) {
             echo lang('error_msg');
         }
         $this->taobao_model->trade_get($resp, $now);
     }
 }
开发者ID:ohjack,项目名称:mallerp_standard,代码行数:18,代码来源:auto_taobao.php

示例8: writeLog

 function writeLog()
 {
     $date = get_current_date();
     $filename = ROOT_DIR . 'log/log_info' . $date;
     if (!file_exists($filename)) {
         $fp = fopen($filename, "wa");
         fclose($fp);
     }
     $data = get_current_time() . " " . $this->getIp() . " " . $this->getInfo() . PHP_EOL;
     try {
         file_put_contents($filename, $data, FILE_APPEND | LOCK_EX);
     } catch (Exception $ex) {
         print_r("<pre>");
         print_r($ex->getMessage());
         print_r($ex->getTrace());
         print_r("</pre>");
         die;
     }
 }
开发者ID:tttodorov13,项目名称:suSurvey,代码行数:19,代码来源:Info.php

示例9: save_accounting_costs

 public function save_accounting_costs()
 {
     $order_count = $this->input->post('order_count');
     $user_id = get_current_user_id();
     for ($i = 0; $i < $order_count; $i++) {
         $order_id = $this->input->post('order_id_' . $i);
         $shipping_cost = trim($this->input->post('shipping_cost_' . $i));
         $product_cost = trim($this->input->post('product_cost_' . $i));
         $product_cost_string = trim(trim($this->input->post('product_cost_string_' . $i)), ',');
         if (!is_numeric($shipping_cost) || !is_numeric($product_cost) || $shipping_cost <= 0 || $product_cost <= 0) {
             continue;
         }
         try {
             $data = array('cost_user' => $user_id, 'cost_date' => get_current_time(), 'cost' => $shipping_cost + $product_cost, 'shipping_cost' => $shipping_cost, 'product_cost_all' => $product_cost, 'product_cost' => $product_cost_string);
             $this->order_model->update_order_information($order_id, $data);
             calculate_order_profit_rate($order_id);
         } catch (Exception $e) {
             echo lang('error_msg');
             $this->ajax_failed();
         }
     }
     echo $this->create_json(1, lang('stock_check_or_count_successfully'));
 }
开发者ID:ohjack,项目名称:mallerp_standard,代码行数:23,代码来源:accounting_cost.php

示例10: new_dataset

 function new_dataset()
 {
     $data['content'] = 'dataset-new';
     $data['nav'] = 'dataset';
     $data['title'] = 'Add Data Set';
     if ($this->input->post()) {
         $dataset = array('dataset_name' => $this->input->post('datasetname'), 'create_at' => get_current_time());
         if ($dataset['dataset_name'] == "") {
             $data['status'] = 0;
             $data['message'] = 'The name of dataset cannot be empty';
         } else {
             $num_rows = $this->db->where('dataset_name', $dataset['dataset_name'])->from('dataset')->count_all_results();
             if ($num_rows > 0) {
                 $data['status'] = 0;
                 $data['message'] = $dataset['dataset_name'] . ' has already existed';
             } else {
                 $data['status'] = 1;
                 $data['message'] = $dataset['dataset_name'] . ' dataset added successfully';
                 $this->db->insert('dataset', $dataset);
             }
         }
     }
     $this->load->view('/template/header', $data);
 }
开发者ID:Kaelcao,项目名称:cbir,代码行数:24,代码来源:UI.php

示例11: stChangeOrderStatus

function stChangeOrderStatus($orderID, $statusID, $comment = '', $notify = 0)
{
    $q_status_name = db_query("select status_name from " . ORDER_STATUES_TABLE . " where statusID=" . (int) $statusID);
    list($status_name) = db_fetch_row($q_status_name);
    $sql = "insert into " . ORDER_STATUS_CHANGE_LOG_TABLE . " ( orderID, status_name, status_change_time, status_comment ) " . " values( " . (int) $orderID . ", '" . xToText($status_name) . "', '" . xEscSQL(get_current_time()) . "', '" . xToText(trim($comment)) . "' ) ";
    db_query($sql);
    if ($notify) {
        $Order = ordGetOrder($orderID);
        $t = '';
        $Email = '';
        $FirstName = '';
        regGetContactInfo(regGetLoginById($Order['customerID']), $t, $Email, $FirstName, $t, $t, $t);
        if (!$Email) {
            $Email = $Order['customer_email'];
        }
        if (!$FirstName) {
            $FirstName = $Order['customer_firstname'];
        }
        xMailTxt($Email, STRING_CHANGE_ORDER_STATUS, 'customer.order.change_status.tpl', array('customer_firstname' => $FirstName, '_MSG_CHANGE_ORDER_STATUS' => str_replace(array('{STATUS}', '{ORDERID}'), array($status_name == 'STRING_CANCELED_ORDER_STATUS' ? STRING_CANCELED_ORDER_STATUS : $status_name, $orderID), MSG_CHANGE_ORDER_STATUS), '_ADMIN_COMMENT' => $comment));
    }
}
开发者ID:gblok,项目名称:rsc,代码行数:21,代码来源:statistic_functions.php

示例12: save_return_order

 public function save_return_order($tag = NULL)
 {
     $id = $this->input->post('id');
     $item_no = $this->input->post('item_no');
     //        $view_return_cost = $this ->input ->post('view_return_cost');
     $order = $this->order_model->get_order_with_id($id);
     if (!empty($order->return_cost)) {
         $return_cost = $this->input->post('return_cost') + $order->return_cost;
     } else {
         $return_cost = $this->input->post('return_cost');
     }
     $return_type = $this->input->post('return_type');
     $return_type_string = $this->order_model->fetch_status_name('order_status', $return_type);
     $sys_remark = $order->sys_remark;
     $sys_remark .= sprintf(lang('apply_action_by_sys_remark'), get_current_user_name(), get_current_time(), lang($return_type_string), $return_cost . "( {$order->currency})");
     $status_id_wfa = $this->order_model->fetch_status_id('order_status', 'wait_for_assignment');
     $status_id_wfc = $this->order_model->fetch_status_id('order_status', 'wait_for_confirmation');
     $status_id_h = $this->order_model->fetch_status_id('order_status', 'holded');
     /*
      * 当申请未发货-申请退款时(待客服分配,待客服确认,客服暂不确认), 状态直接改为未发货-申请退款。
      * **/
     if ($order->order_status == $status_id_wfa || $order->order_status == $status_id_wfc || $order->order_status == $status_id_h) {
         $return_type = $this->order_model->fetch_status_id('order_status', 'not_shipped_apply_for_refund');
         $sys_remark = $order->sys_remark;
         $sys_remark .= sprintf(lang('apply_action_by_sys_remark'), get_current_user_name(), get_current_time(), lang('not_shipped_apply_for_refund'), $return_cost . "( {$order->currency})");
     }
     $status_id = $this->order_model->get_one('order_list', 'order_status', array('id' => $id));
     $return_status = $this->order_model->fetch_status_name('order_status', $status_id);
     /**
      * 前:已发货时的几种状态, 中: 未发货时的状态 , 后:二次退款的。
      */
     $return_status_arr = array('wait_for_purchase', 'wait_for_shipping_label', 'wait_for_shipping_confirmation', 'wait_for_feedback', 'received', 'wait_for_assignment', 'wait_for_confirmation', 'holded', 'not_received_partial_refunded', 'received_partial_refunded');
     $rules = array(array('field' => 'remark', 'label' => lang('remark'), 'rules' => 'trim|required'));
     $return_type_nrar = $this->order_model->fetch_status_id('order_status', 'not_received_apply_for_partial_refund');
     $return_type_rar = $this->order_model->fetch_status_id('order_status', 'received_apply_for_partial_refund');
     $status = $this->order_model->fetch_status_name('order_status', $return_type);
     /**
      * Form 验证。
      */
     $this->form_validation->set_rules($rules);
     if ($this->form_validation->run() == FALSE) {
         $error = validation_errors();
         echo $this->create_json(0, $error);
         return;
     }
     /**
      *   这里是申请审核的。
      */
     $user_priority = $this->user_model->fetch_user_priority_by_system_code('order');
     //        if($user_priority+1 >= 2)//Test
     if ($user_priority >= 2) {
         if ($tag == 'approved') {
             $order_status_approved = $this->order_model->get_one('order_list', 'order_status', array('id' => $id));
             $return_type_string = $this->order_model->fetch_status_name('order_status', $order_status_approved);
             if ($return_type_string == 'not_received_approved_resending' || $return_type_string == 'received_approved_resending') {
                 echo $this->create_json(0, lang('review_finish'));
                 return;
             }
             switch ($return_type_string) {
                 case 'not_received_apply_for_partial_refund':
                     $return_type = $this->order_model->fetch_status_id('order_status', 'not_received_partial_refunded');
                     break;
                 case 'not_received_apply_for_full_refund':
                     $return_type = $this->order_model->fetch_status_id('order_status', 'not_received_full_refunded');
                     //                        $return_cost = $view_return_cost;
                     break;
                 case 'not_received_apply_for_resending':
                     $return_type = $this->order_model->fetch_status_id('order_status', 'not_received_approved_resending');
                     break;
                 case 'received_apply_for_partial_refund':
                     $return_type = $this->order_model->fetch_status_id('order_status', 'received_partial_refunded');
                     break;
                 case 'received_apply_for_full_refund':
                     $return_type = $this->order_model->fetch_status_id('order_status', 'received_full_refunded');
                     //                        $return_cost = $view_return_cost;
                     break;
                 case 'received_apply_for_resending':
                     $return_type = $this->order_model->fetch_status_id('order_status', 'received_approved_resending');
                     break;
                 case 'not_shipped_apply_for_refund':
                     $return_type = $this->order_model->fetch_status_id('order_status', 'not_shipped_agree_to_refund');
                     break;
                 default:
                     echo $this->create_json(0, lang('no_return'));
                     return;
             }
             $return_cost = $this->input->post('return_cost');
             $sys_remark = $order->sys_remark;
             //                $sys_remark .= sprintf(lang('approved_by_sys_remark'), get_current_time(), get_current_user_name());
             $sys_remark .= sprintf(lang('approved_by_sys_remark_for_one'), get_current_time(), get_current_user_name(), $return_cost . "( {$order->currency})");
             $descript = $order->descript;
             $descript .= sprintf(lang('approved_by_sys_remark_for_one'), get_current_time(), get_current_user_name(), $return_cost . "( {$order->currency})");
         } elseif ($tag == 'rejected') {
             $not_ship_id = $this->order_model->fetch_status_id('order_status', 'not_shipped_apply_for_refund');
             if ($order->order_status == $not_ship_id) {
                 $holded_id = $this->order_model->fetch_status_id('order_status', 'holded');
                 $order_status_rejected = $holded_id;
                 $sys_remark = $order->sys_remark;
                 $sys_remark .= sprintf(lang('rejected_by_sys_remark'), get_current_user_name(), get_current_time(), lang('not_shipped_apply_for_refund'), lang('holded'));
                 $descript = $order->descript;
//.........这里部分代码省略.........
开发者ID:ohjack,项目名称:mallerp_standard,代码行数:101,代码来源:special_order.php

示例13: verify_order_before_print_label

 public function verify_order_before_print_label($order_id)
 {
     if (strpos($_SERVER['SCRIPT_FILENAME'], 'auto_verify_order_after_change.php') === FALSE) {
         exit;
     }
     if (empty($order_id)) {
         return;
     }
     $order = $this->order_model->get_order($order_id);
     $wait_for_purchase_status = fetch_status_id('order_status', 'wait_for_purchase');
     $wait_for_finance_status = fetch_status_id('order_status', 'wait_for_finance_confirmation');
     $sys_remark = $order->sys_remark . sprintf(lang('purchase_to_finance_confirmation_note_due_to_profit_rate'), get_current_time(), lang('system'));
     $skus = explode(',', $order->sku_str);
     $qties = explode(',', $order->qty_str);
     $product_price = 0;
     $shipping_weight = 0;
     $i = 0;
     foreach ($skus as $sku) {
         $qty = $qties[$i];
         $i++;
         $product = $this->product_model->fetch_product_by_sku($sku);
         $product_price += $product->price * $qty;
         $shipping_weight += $product->total_weight * $qty;
     }
     $order_data = array('item_id_str' => $order->item_id_str, 'gross' => $order->gross, 'net' => $order->net, 'currency' => $order->currency, 'transaction_ids' => $order->transaction_id, 'shipping_code' => $order->is_register, 'price' => $product_price, 'shipping_weight' => $shipping_weight, 'country' => $order->country);
     $result = $this->_calculate_profit_rate($order_data);
     if (isset($result['profit_rate'])) {
         $data = array();
         $profit = $result['profit'];
         $profit_rate = $result['profit_rate'];
         if ($profit < -1 or $profit_rate < -0.1 or $profit_rate > 0.3) {
             if ($order->order_status == $wait_for_purchase_status) {
                 $data = array('order_status' => $wait_for_finance_status, 'sys_remark' => $sys_remark);
             }
         }
         $data['profit_rate'] = $result['profit_rate'];
         $data['shipping_cost'] = $result['shipping_cost'];
         $data['product_cost_all'] = $result['product_cost'];
         $data['trade_fee'] = $result['trade_fee'];
         $data['listing_fee'] = $result['listing_fee'];
         /*  Not activate it currently.
              *
             $order_role = $this->_get_order_role($order->sku_str, $order->to_email);
             $data['stock_user_id'] = $order_role['stock_user_id'];
             $data['purchaser_id_str'] = $order_role['purchaser_id_str'];
             $data['developer_id'] = $order_role['developer_id'];
             $data['saler_id'] = $order_role['saler_id'];
             */
         $this->order_model->update_order_information($order_id, $data);
     }
 }
开发者ID:ohjack,项目名称:mallerp_standard,代码行数:51,代码来源:auto.php

示例14: auditing_order_rejecteds

 public function auditing_order_rejecteds($tag = NULL)
 {
     $order_id = $this->input->post('order_id');
     $order = $this->order_model->get_order_with_id($order_id);
     if (empty($order)) {
         return;
     }
     $sys_remark = $order->sys_remark;
     $sys_remark .= sprintf(lang('batch_rejected_by_sys_remark_one'), get_current_time(), get_current_user_name());
     $descript = $order->descript;
     $descript .= sprintf(lang('batch_rejected_by_sys_remark_one'), get_current_time(), get_current_user_name());
     $margin_arr = explode('|', $order->return_why);
     if (count($margin_arr) == 2) {
         $return_cost = $order->return_cost - $margin_arr[1];
     }
     $return_why = $margin_arr[0];
     try {
         $data = array('order_status' => $this->order_model->fetch_status_id('order_status', 'wait_for_feedback'), 'sys_remark' => $sys_remark, 'descript' => $descript, 'return_why' => $return_why);
         if (isset($return_cost)) {
             $data['return_cost'] = $return_cost;
         }
         $order_status_no_ship = $this->order_model->fetch_status_name('order_status', $order->order_status);
         if ($order_status_no_ship == 'not_shipped_apply_for_refund') {
             $data['order_status'] = $this->order_model->fetch_status_id('order_status', 'holded');
         }
         $this->order_model->update_order_information($order_id, $data);
         echo $this->create_json(1, 'ok');
     } catch (Exception $e) {
         echo lang('error_msg');
         $this->ajax_failed();
     }
 }
开发者ID:ohjack,项目名称:mallerp_standard,代码行数:32,代码来源:return_order_auditing.php

示例15: ordAccessToLoadFile

function ordAccessToLoadFile($orderID, $productID, &$pathToProductFile, &$productFileShortName)
{
    $order = ordGetOrder($orderID);
    $product = GetProduct($productID);
    if (strlen($product['eproduct_filename']) == 0 || !file_exists('core/files/' . $product['eproduct_filename']) || $product['eproduct_filename'] == null) {
        return 4;
    }
    if ((int) $order['statusID'] != (int) ostGetCompletedOrderStatus()) {
        return 3;
    }
    $orderContent = ordGetOrderContent($orderID);
    foreach ($orderContent as $item) {
        if (GetProductIdByItemId($item['itemID']) == $productID) {
            if ($item['load_counter'] < $product['eproduct_download_times'] || $product['eproduct_download_times'] == 0) {
                $date1 = dtGetParsedDateTime($order['order_time_mysql']);
                //$order['order_time']
                $date2 = dtGetParsedDateTime(get_current_time());
                $countDay = _getDayBetweenDate($date1, $date2);
                if ($countDay >= $product['eproduct_available_days']) {
                    return 2;
                }
                if ($product['eproduct_download_times'] != 0) {
                    db_query('update ' . ORDERED_CARTS_TABLE . ' set load_counter=load_counter+1 ' . ' where itemID=' . (int) $item['itemID'] . ' AND orderID=' . (int) $orderID);
                }
                $pathToProductFile = 'core/files/' . $product['eproduct_filename'];
                $productFileShortName = $product['eproduct_filename'];
                return 0;
            } else {
                return 1;
            }
        }
    }
    return -1;
}
开发者ID:gblok,项目名称:rsc,代码行数:34,代码来源:order_functions.php


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