public function UpdateOrderStatus($status, $orderCode)
 {
     // TODO Auto-generated method stub
     FuegoLog::getLog()->LogInfo('update order status');
     $orderDao = LaundryDaoContext::Order();
     $condition['order_code'] = $orderCode;
     if ($status == "TRADE_SUCCESS") {
         FuegoLog::getLog()->LogInfo('order pay success');
         $result = $orderDao->where($condition)->setField('order_status', OrderEnum::PaySuccess);
     } elseif ($status == "TRADE_FINISHED") {
         FuegoLog::getLog()->LogInfo('order pay finished');
         $result = $orderDao->where($condition)->setField('order_status', OrderEnum::PayFinished);
     } else {
         FuegoLog::getLog()->LogInfo('order pay failed, wait buyer pay.');
         $result = $orderDao->where($condition)->setField('order_status', OrderEnum::WaitBuyerPay);
     }
     if ($result) {
         FuegoLog::getLog()->LogInfo('update order status success');
     } else {
         FuegoLog::getLog()->LogErr('update order status failed');
     }
 }
 public function Show()
 {
     $reqType = $this->GetReqType();
     if ($reqType == ClientTypeEnum::IOS || $reqType == ClientTypeEnum::ANDROID) {
         //验证APP是否登录
         $this->DoAuth();
     }
     $objID = $this->GetCommonData();
     $this->LogInfo("show customer, user_id is " . $objID);
     $viewCustomerDao = LaundryDaoContext::ViewCustomer();
     $condition['user_id'] = $objID;
     try {
         $object = MispCommonService::GetUniRecord($viewCustomerDao, $condition);
     } catch (FuegoException $e) {
         $this->errorCode = $e->getCode();
         $this->ReturnJson();
         return;
     }
     $data['obj'] = $object;
     $this->ReturnJson($data);
 }
 protected function GetModel()
 {
     return LaundryDaoContext::advertisement();
 }
 public function CreateAdmin($admin)
 {
     $errorCode = MispErrorCode::SUCCESS;
     FuegoLog::getLog()->LogInfo("Create admin");
     $adminDao = LaundryDaoContext::administrators();
     try {
         $result = MispCommonService::Create($adminDao, $admin);
     } catch (FuegoException $e) {
         $errorCode = $e->getCode();
     }
     return $errorCode;
 }
 public function Delete()
 {
     $Req = $this->GetReqObj();
     $this->LogInfo("delete order, order id is " . $Req->obj);
     $condition['order_id'] = $Req->obj;
     $orderDetailDao = LaundryDaoContext::OrderDetail();
     try {
         $result = MispCommonService::Delete($orderDetailDao, $condition);
     } catch (FuegoException $e) {
         $this->errorCode = $e->getCode();
         $this->ReturnJson();
         return;
     }
     parent::Delete();
 }
 public function Show()
 {
     $objID = $this->GetCommonData();
     $this->LogInfo("show admin, user_id is " . $objID);
     $viewAdminDao = LaundryDaoContext::ViewAdmin();
     $condition['user_id'] = $objID;
     try {
         $object = MispCommonService::GetUniRecord($viewAdminDao, $condition);
     } catch (FuegoException $e) {
         $this->errorCode = $e->getCode();
         $this->ReturnJson();
         return;
     }
     $data['obj'] = $object;
     $this->ReturnJson($data);
 }
 public function getProductTypeList()
 {
     $this->LogInfo("Load product type list.");
     $productTypeDao = LaundryDaoContext::ProductType();
     //$condition['parent_id']= ROOTTYPE;
     $productTypeList = $productTypeDao->select();
     //$this->LogInfo(json_encode($parentTypeList));
     $comboxDefault = array('type_id' => '', 'type_name' => '请选择...');
     $comboxTypeList = array();
     array_push($comboxTypeList, $comboxDefault);
     foreach ($productTypeList as $productType) {
         $combox['type_id'] = $productType['type_id'];
         $combox['type_name'] = $productType['type_name'];
         //$combox['parent_name'] = $productType['type_name'];
         array_push($comboxTypeList, $combox);
     }
     $this->LogInfo("The product type list is " . json_encode($comboxTypeList));
     echo json_encode($comboxTypeList);
     exit;
 }