Browse Source

订单提交

dev
nizongfeng 3 years ago
parent
commit
a0fa4d4def
5 changed files with 21 additions and 21 deletions
  1. +2
    -2
      application/admin/service/CfChannelInfoDao.php
  2. +2
    -2
      application/admin/service/CfSuplierInfoDao.php
  3. +8
    -8
      application/admin/service/OrderHotelDao.php
  4. +7
    -7
      application/admin/service/OrderItemDao.php
  5. +2
    -2
      application/admin/service/OrderMainDao.php

+ 2
- 2
application/admin/service/CfChannelInfoDao.php View File

@@ -23,11 +23,11 @@ class CfChannelInfoDao
public function getInfoById(int $id) {
try{
$model = new CfChannelInfo();
$info = $model->where(["id"=>$id])->find()->toArray();
$info = $model->where(["id"=>$id])->find();
if ($info == null) {
return Util::returnArrEr("获取渠道信息失败:".$id);
}
return Util::returnArrSu("",$info);
return Util::returnArrSu("",$info->toArray());
}catch (Exception $e){
return Util::returnArrEr("获取渠道信息失败:".$e->getMessage());
}


+ 2
- 2
application/admin/service/CfSuplierInfoDao.php View File

@@ -23,11 +23,11 @@ class CfSuplierInfoDao
public function getInfoById(int $id) {
try{
$model = new CfSuplierInfo();
$info = $model->where(["id"=>$id])->find()->toArray();
$info = $model->where(["id"=>$id])->find();
if ($info == null) {
return Util::returnArrEr("获取供应商信息失败:".$id);
}
return Util::returnArrSu("",$info);
return Util::returnArrSu("",$info->toArray());
}catch (Exception $e){
return Util::returnArrEr("获取供应商信息失败:".$e->getMessage());
}


+ 8
- 8
application/admin/service/OrderHotelDao.php View File

@@ -91,11 +91,11 @@ class OrderHotelDao
{
try {
$model = new CfHotelInfo();
$result = $model->where(["id" => $id])->find()->toArray();
$result = $model->where(["id" => $id])->find();
if ($result == null) {
return Util::returnArrEr("获取酒店信息失败:" . $id);
}
return Util::returnArrSu("",$result);
return Util::returnArrSu("",$result->toArray());
} catch (Exception $e) {
return Util::returnArrEr("获取酒店信息失败:" . $id);
}
@@ -110,11 +110,11 @@ class OrderHotelDao
{
try {
$model = new CfRoomInfo();
$result = $model->where(["id" => $id])->find()->toArray();
$result = $model->where(["id" => $id])->find();
if ($result == null) {
return Util::returnArrEr("获取房型信息失败:" . $id);
}
return Util::returnArrSu("", $result);
return Util::returnArrSu("", $result->toArray());
} catch (Exception $e) {
return Util::returnArrEr("获取房型信息失败:" . $id);
}
@@ -129,11 +129,11 @@ class OrderHotelDao
{
try {
$model = new CfRoomPlan();
$result = $model->where(["id" => $id])->find()->toArray();
$result = $model->where(["id" => $id])->find();
if ($result == null) {
return Util::returnArrEr("获取价格方案信息失败:" . $id);
}
return Util::returnArrSu("",$result);
return Util::returnArrSu("",$result->toArray());
} catch (Exception $e) {
return Util::returnArrEr("获取价格方案信息失败:" . $id);
}
@@ -173,11 +173,11 @@ class OrderHotelDao
public function getInfoById($id) {
try {
$model = new OrderHotel();
$result = $model->where(["id" => $id])->find()->toArray();
$result = $model->where(["id" => $id])->find();
if ($result == null) {
return Util::returnArrEr("获取子订单信息失败:" . $id);
}
return Util::returnArrSu("",$result);
return Util::returnArrSu("",$result->toArray());
} catch (Exception $e) {
return Util::returnArrEr("获取子订单信息失败:" . $id);
}


+ 7
- 7
application/admin/service/OrderItemDao.php View File

@@ -78,11 +78,11 @@ class OrderItemDao
{
try {
$model = new CfItem();
$result = $model->where(["id" => $id])->find()->toArray();
$result = $model->where(["id" => $id])->find();
if ($result == null) {
return Util::returnArrEr("获取附加项目信息失败:" . $id);
}
return Util::returnArrSu("",$result);
return Util::returnArrSu("",$result->toArray());
} catch (Exception $e) {
return Util::returnArrEr("获取附加项目信息失败:" . $id);
}
@@ -96,7 +96,7 @@ class OrderItemDao
public function setSubOrderAmount( int $subOrderId) {
try{
$purchaseModel = new Purchase();
$purchaseList = $purchaseModel->where(["order_detail_id"=>$subOrderId,"del_flag"=>0])->select();
$purchaseList = $purchaseModel->where(["order_detail_id"=>$subOrderId,"del_flag"=>0])->select()->toArray();
$cost = 0;
$amount = 0;
$count = 0;
@@ -107,7 +107,7 @@ class OrderItemDao
}
//更新数据
$oderItem = new OrderItem();
$oderItem->save(["total_price"=>$amount,"total_cost"=>$cost,"prod_num"=>$count,"profit"=>$amount-$cost])->where(["id"=>$subOrderId]);
$oderItem->save(["total_price"=>$amount,"total_cost"=>$cost,"prod_num"=>$count,"profit"=>$amount-$cost],["id"=>$subOrderId]);
return Util::returnArrSu();
}catch (Exception $e){
return Util::returnArrEr("更新附加项目订单子表金额失败:".$subOrderId);
@@ -123,11 +123,11 @@ class OrderItemDao
public function getInfoById($id) {
try {
$model = new OrderItem();
$result = $model->where(["id" => $id])->find()->toArray();
$result = $model->where(["id" => $id])->find();
if ($result == null) {
return Util::returnArrEr("获取子订单信息失败:" . $id);
}
return Util::returnArrSu("", $result);
return Util::returnArrSu("", $result->toArray());
} catch (Exception $e) {
return Util::returnArrEr("获取子订单信息失败:" . $id);
}
@@ -159,7 +159,7 @@ class OrderItemDao
public function getListByOrderId($orderId){
$subOrderModel = new OrderItem();
try {
$subOrderList = $subOrderModel->where(["order_id" => $orderId, "del_flag" => 0])->select();
$subOrderList = $subOrderModel->where(["order_id" => $orderId, "del_flag" => 0])->select()->toArray();
if (null == $subOrderList) {
return Util::returnArrSu("",[]);
}


+ 2
- 2
application/admin/service/OrderMainDao.php View File

@@ -101,11 +101,11 @@ class OrderMainDao
public function getInfoById($id) {
try {
$orderMainModel = new OrderMain();
$orderMain = $orderMainModel->where(["id" => $id])->find()->toArray();
$orderMain = $orderMainModel->where(["id" => $id])->find();
if (null == $orderMain) {
return Util::returnArrEr("订单查询失败:".$id);
}
return Util::returnArrSu("",$orderMain);
return Util::returnArrSu("",$orderMain->toArray());
}catch (Exception $e) {
return Util::returnArrEr("订单查询失败:".$e->getMessage());
}


Loading…
Cancel
Save