예제 #1
0
 /**
  * 批量删除支付
  */
 public function batch_delete()
 {
     role::check('manage_payment');
     //初始化返回数据
     $return_data = array();
     //请求结构体
     $request_data = array();
     try {
         $payment_ids = $this->input->post('payment_ids');
         if (is_array($payment_ids) && count($payment_ids) > 0) {
             /* 删除失败的 */
             $failed_payment_names = '';
             /* 执行操作 */
             foreach ($payment_ids as $payment_id) {
                 if (!Mypayment::instance($payment_id)->delete()) {
                     $failed_payment_names .= ' | ' . $payment_id;
                 }
             }
             if (empty($failed_payment_names)) {
                 throw new MyRuntimeException(Kohana::lang('o_manage.delete_payment_success'), 403);
             } else {
                 /* 中转提示页面的停留时间 */
                 $return_struct['action']['time'] = 10;
                 $failed_payment_names = trim($failed_payment_names, ' | ');
                 throw new MyRuntimeException(Kohana::lang('o_manage.delete_payment_error', $failed_payment_names), 403);
             }
         } else {
             throw new MyRuntimeException(Kohana::lang('o_global.data_load_error'), 403);
         }
     } catch (MyRuntimeException $ex) {
         $return_struct['status'] = 0;
         $return_struct['code'] = $ex->getCode();
         $return_struct['msg'] = $ex->getMessage();
         //TODO 异常处理
         //throw $ex;
         if ($this->is_ajax_request()) {
             $this->template = new View('layout/empty_html');
             $this->template->content = $return_struct['msg'];
         } else {
             $this->template->return_struct = $return_struct;
             $content = new View('info');
             $this->template->content = $content;
             /* 请求结构数据绑定 */
             $this->template->content->request_data = $request_data;
             /* 返回结构体绑定 */
             $this->template->content->return_struct = $return_struct;
         }
     }
 }
예제 #2
0
echo $order['email'];
?>
</td>
                    </tr>
                    <tr>
                        <td class="a_right a_title">IP/地址:</td>
                        <td class="a_left"><?php 
echo long2ip($order['ip']);
?>
<span id="ip_country"></span></td>
                    </tr>
                    <?php 
if (!empty($order['payment_id'])) {
    ?>
                    <?php 
    $payment = Mypayment::instance($order['payment_id'])->get();
    $payment_type_id = !empty($payment['payment_type_id']) ? $payment['payment_type_id'] : 0;
    if (!empty($payment_type_id)) {
        $payment_type = Mypayment_type::instance($payment_type_id)->get();
    }
    $payment_type_name = !empty($payment_type['name']) ? $payment_type['name'] : '';
    ?>
                    <tr>
                        <td class="a_right a_title">支付方式:</td>
                        <td class="a_left"><?php 
    echo $payment_type_name;
    ?>
</td>
                    </tr>
                    <?php 
}