Exemplo n.º 1
0
 public function orderlistAction()
 {
     if ($this->_auth->userid && $this->_auth->role == 3) {
         $cardOrders = Application_Model_M_MemberCardOrder::fetchByHospital($this->_auth->userid);
         $reservationOrders = Application_Model_M_ReservationOrder::fetchByHospital($this->_auth->userid);
         $travelOrders = Application_Model_M_TravelOrder::fetchByHospital($this->_auth->userid);
         $orders = array();
         if (count($cardOrders) > 0) {
             //$cards = array();
             foreach ($cardOrders as $cardOrder) {
                 $card = array('orderid' => $cardOrder->getOrder_id(), 'price' => $cardOrder->getTotal_price(), 'status' => $cardOrder->getPayment_status());
                 if (@$_GET['lang'] == 1) {
                     $remark = 'payment for buy card';
                 } else {
                     $remark = '购卡订单';
                 }
                 $card['remark'] = $remark;
                 array_push($orders, $card);
             }
         }
         if (count($reservationOrders) > 0) {
             //$reservations = array();
             foreach ($reservationOrders as $reservationOrder) {
                 $reservation = array('orderid' => $reservationOrder->getOrder_id(), 'price' => $reservationOrder->getTotal_price(), 'status' => $reservationOrder->getPayment_status());
                 if (@$_GET['lang'] == 1) {
                     $remark = 'payment for reservation doctor';
                 } else {
                     $remark = '咨询医生订单';
                 }
                 $reservation['remark'] = $remark;
                 array_push($orders, $reservation);
             }
         }
         if (count($travelOrders) > 0) {
             //$travels = array();
             foreach ($travelOrders as $travelOrder) {
                 $travel = array('orderid' => $travelOrder->getOrder_id(), 'price' => $travelOrder->getTotal_price(), 'status' => $travelOrder->getPayment_status());
                 if (@$_GET['lang'] == 1) {
                     $remark = 'payment for imt';
                 } else {
                     $remark = '医游订单';
                 }
                 $travel['remark'] = $remark;
                 array_push($orders, $travel);
             }
         }
         if (count($orders) > 0) {
             $out['errno'] = '0';
             $out['orders'] = $orders;
         } else {
             $out['errno'] = '1';
         }
     } else {
         $out['errno'] = '200';
     }
     $out['msg'] = Yy_ErrMsg_Hospital::getMsg('order', $out['errno']);
     Yy_Utils::jsonOut($out);
 }
Exemplo n.º 2
0
 public function delete()
 {
     $where = 'id=' . $this->getId();
     return Application_Model_M_ReservationOrder::delete($where);
 }