Exemple #1
0
 public function edit_post()
 {
     $data = $this->data;
     //取得公用數據
     //基本post欄位
     $orderid_Num = $this->input->post('orderid_Num', TRUE);
     $paycheck_status_Num = $this->input->post('paycheck_status_Num', TRUE);
     $product_status_Num = $this->input->post('product_status_Num', TRUE);
     $receive_name_Str = $this->input->post('receive_name_Str', TRUE);
     $receive_phone_Str = $this->input->post('receive_phone_Str', TRUE);
     $receive_time_Str = $this->input->post('receive_time_Str');
     $receive_address_Str = $this->input->post('receive_address_Str');
     $receive_remark_Str = $this->input->post('receive_remark_Str', TRUE);
     $transport_id_Str = $this->input->post('transport_id_Str', TRUE);
     $sendtime_Str = $this->input->post('sendtime_Str', TRUE);
     $order_status_Num = $this->input->post('order_status_Num', TRUE);
     $content_Str = $this->input->post('content_Str', TRUE);
     //建構OrderShop物件,並且更新
     $OrderShop = new OrderShop();
     $OrderShop->construct(array('orderid_Num' => $orderid_Num, 'paycheck_status_Num' => $paycheck_status_Num, 'product_status_Num' => $product_status_Num, 'receive_name_Str' => $receive_name_Str, 'receive_phone_Str' => $receive_phone_Str, 'receive_time_Str' => $receive_time_Str, 'receive_address_Str' => $receive_address_Str, 'receive_remark_Str' => $receive_remark_Str, 'transport_id_Str' => $transport_id_Str, 'sendtime_Str' => $sendtime_Str, 'updatetime_Str' => '', 'order_status_Num' => $order_status_Num));
     $OrderShop->update(array('db_update_Arr' => array('paycheck_status', 'product_status', 'receive_name', 'receive_phone', 'receive_time', 'receive_address', 'receive_remark', 'transport_id', 'sendtime', 'updatetime', 'order_status')));
     if (!empty($content_Str)) {
         $Comment = new Comment();
         $Comment->construct(['uid_Num' => $data['User']->uid_Num, 'typename_Str' => 'order', 'id_Num' => $OrderShop->orderid_Num, 'content_Str' => $content_Str]);
         $Comment->update();
     }
     //送出成功訊息
     $this->load->model('Message');
     $this->Message->show(array('message' => '設定成功', 'url' => 'admin/shop/order_shop/order_shop/tablelist'));
 }
Exemple #2
0
 public function edit_post()
 {
     $data = $this->data;
     //取得公用數據
     $orderid_Num = $this->input->post('orderid_Num', TRUE);
     //基本post欄位
     $pay_account_Str = $this->input->post('pay_account_Str', TRUE);
     $pay_name_Str = $this->input->post('pay_name_Str', TRUE);
     $pay_paytime_Str = $this->input->post('pay_paytime_Str', TRUE);
     $pay_remark_Str = $this->input->post('pay_remark_Str', TRUE);
     $content_Str = $this->input->post('content_Str', TRUE);
     if (!empty($pay_account_Str) && !empty($pay_name_Str) && !empty($pay_paytime_Str)) {
         //建構OrderShop物件,並且更新
         $OrderShop = new OrderShop();
         $OrderShop->construct(array('orderid_Num' => $orderid_Num, 'pay_account_Str' => $pay_account_Str, 'pay_name_Str' => $pay_name_Str, 'pay_paytime_Str' => $pay_paytime_Str, 'pay_remark_Str' => $pay_remark_Str, 'pay_status_Num' => 1));
         $OrderShop->update(array('db_update_Arr' => array('pay_account', 'pay_name', 'pay_paytime', 'pay_remark', 'pay_status')));
     }
     if (!empty($content_Str)) {
         $Comment = new Comment();
         $Comment->construct(['uid_Num' => $data['User']->uid_Num, 'typename_Str' => 'order', 'id_Num' => $orderid_Num, 'content_Str' => $content_Str]);
         $Comment->update();
     }
     //送出成功訊息
     $this->load->model('Message');
     $this->Message->show(array('message' => '設定成功', 'url' => 'admin/user/order_shop/order_shop/tablelist'));
 }
Exemple #3
0
 public function add_cart()
 {
     $data = $this->data;
     $productid_Num = $this->input->post('productid_Num', TRUE);
     $stockid_Num = $this->input->post('stockid_Num', TRUE);
     $amount_Num = $this->input->post('amount_Num', TRUE);
     if (empty($productid_Num) || empty($stockid_Num) || empty($amount_Num)) {
         $message_Str = '產品訊息傳遞錯誤';
         $url_Str = 'order/cartlist';
         $this->load->model('Message');
         $this->Message->show(array('message' => $message_Str, 'url' => $url_Str));
     }
     //讀取建構中的訂單
     $OrderShop = new OrderShop(['db_where_Arr' => array('uid_Num' => $data['User']->uid_Num, 'order_status_Num' => -1)]);
     $data['transportList'] = new ObjList(['db_where_deletenull_Bln' => TRUE, 'model_name_Str' => 'Transport', 'limitstart_Num' => 0, 'limitcount_Num' => 100]);
     //如果沒有建構中的訂單則建立一個新的訂單
     if (empty($OrderShop->orderid_Num)) {
         $OrderShop = new OrderShop(['uid_Num' => $data['User']->uid_Num, 'transport_mode_Str' => $data['transportList']->obj_Arr[0]->name_Str, 'transport_base_price_Num' => $data['transportList']->obj_Arr[0]->base_price_Num, 'transport_additional_price_Num' => $data['transportList']->obj_Arr[0]->additional_price_Num, 'pay_paytype_Str' => 'atm', 'order_status_Num' => -1]);
         $OrderShop->update();
     }
     $OrderShop->add_cart(['productid_Num' => $productid_Num, 'stockid_Num' => $stockid_Num, 'amount_Num' => $amount_Num]);
     $OrderShop->update();
     $url_Str = base_url('order/cartlist');
     header("Location: {$url_Str}");
 }