@@ -36,7 +36,7 @@ class CfHotelInfo extends Model | |||||
}elseif($name){ | }elseif($name){ | ||||
$this->where(['hotel_name'=>['like','%'.$name.'%']]); | $this->where(['hotel_name'=>['like','%'.$name.'%']]); | ||||
} | } | ||||
return $this->select(); | |||||
return $this->select()->toArray(); | |||||
} | } | ||||
@@ -66,8 +66,6 @@ class OrderHotelDao | |||||
"customer_name" => $param['customer_name'], | "customer_name" => $param['customer_name'], | ||||
"customer_comments" => empty($param['customer_comments'])?"":$param['customer_comments'], | "customer_comments" => empty($param['customer_comments'])?"":$param['customer_comments'], | ||||
"trade_order_number" => $param['trade_order_number'], | "trade_order_number" => $param['trade_order_number'], | ||||
"res_person" => $param['res_person'], | |||||
"res_person_id" => empty($param['res_person_id'])?0:$param['res_person_id'], | |||||
"del_flag"=>0 | "del_flag"=>0 | ||||
]; | ]; | ||||
$orderHotelModel = new OrderHotel(); | $orderHotelModel = new OrderHotel(); | ||||
@@ -93,7 +91,7 @@ class OrderHotelDao | |||||
{ | { | ||||
try { | try { | ||||
$model = new CfHotelInfo(); | $model = new CfHotelInfo(); | ||||
$result = $model->where(["id" => $id])->find(); | |||||
$result = $model->where(["id" => $id])->find()->toArray(); | |||||
if ($result == null) { | if ($result == null) { | ||||
return Util::returnArrEr("获取酒店信息失败:" . $id); | return Util::returnArrEr("获取酒店信息失败:" . $id); | ||||
} | } | ||||
@@ -112,7 +110,7 @@ class OrderHotelDao | |||||
{ | { | ||||
try { | try { | ||||
$model = new CfRoomInfo(); | $model = new CfRoomInfo(); | ||||
$result = $model->where(["id" => $id])->find(); | |||||
$result = $model->where(["id" => $id])->find()->toArray(); | |||||
if ($result == null) { | if ($result == null) { | ||||
return Util::returnArrEr("获取房型信息失败:" . $id); | return Util::returnArrEr("获取房型信息失败:" . $id); | ||||
} | } | ||||
@@ -131,7 +129,7 @@ class OrderHotelDao | |||||
{ | { | ||||
try { | try { | ||||
$model = new CfRoomPlan(); | $model = new CfRoomPlan(); | ||||
$result = $model->where(["id" => $id])->find(); | |||||
$result = $model->where(["id" => $id])->find()->toArray(); | |||||
if ($result == null) { | if ($result == null) { | ||||
return Util::returnArrEr("获取价格方案信息失败:" . $id); | return Util::returnArrEr("获取价格方案信息失败:" . $id); | ||||
} | } | ||||
@@ -149,7 +147,7 @@ class OrderHotelDao | |||||
public function setSubOrderAmount( int $subOrderId) { | public function setSubOrderAmount( int $subOrderId) { | ||||
try{ | try{ | ||||
$purchaseModel = new Purchase(); | $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; | $cost = 0; | ||||
$amount = 0; | $amount = 0; | ||||
$count = 0; | $count = 0; | ||||
@@ -175,7 +173,7 @@ class OrderHotelDao | |||||
public function getInfoById($id) { | public function getInfoById($id) { | ||||
try { | try { | ||||
$model = new OrderHotel(); | $model = new OrderHotel(); | ||||
$result = $model->where(["id" => $id])->find(); | |||||
$result = $model->where(["id" => $id])->find()->toArray(); | |||||
if ($result == null) { | if ($result == null) { | ||||
return Util::returnArrEr("获取子订单信息失败:" . $id); | return Util::returnArrEr("获取子订单信息失败:" . $id); | ||||
} | } | ||||
@@ -211,7 +209,7 @@ class OrderHotelDao | |||||
public function getListByOrderId($orderId){ | public function getListByOrderId($orderId){ | ||||
$subOrderModel = new OrderHotel(); | $subOrderModel = new OrderHotel(); | ||||
try { | 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) { | if (null == $subOrderList) { | ||||
return Util::returnArrSu("",[]); | return Util::returnArrSu("",[]); | ||||
} | } | ||||
@@ -51,10 +51,8 @@ class OrderItemDao | |||||
"confirm_status" => $param['confirm_status'], | "confirm_status" => $param['confirm_status'], | ||||
"confirm_no" => $param['confirm_no'], | "confirm_no" => $param['confirm_no'], | ||||
"customer_name" => $param['customer_name'], | "customer_name" => $param['customer_name'], | ||||
"customer_comments" => $param['customer_comments'], | |||||
"customer_comments" => empty($param['customer_comments'])?"":$param['customer_comments'], | |||||
"trade_order_number" => $param['trade_order_number'], | "trade_order_number" => $param['trade_order_number'], | ||||
"res_person" => $param['res_person'], | |||||
"res_person_id" => $param['res_person_id'], | |||||
"del_flag"=>0 | "del_flag"=>0 | ||||
]; | ]; | ||||
$orderHotelModel = new OrderHotel(); | $orderHotelModel = new OrderHotel(); | ||||
@@ -80,7 +78,7 @@ class OrderItemDao | |||||
{ | { | ||||
try { | try { | ||||
$model = new CfItem(); | $model = new CfItem(); | ||||
$result = $model->where(["id" => $id])->find(); | |||||
$result = $model->where(["id" => $id])->find()->toArray(); | |||||
if ($result == null) { | if ($result == null) { | ||||
return Util::returnArrEr("获取附加项目信息失败:" . $id); | return Util::returnArrEr("获取附加项目信息失败:" . $id); | ||||
} | } | ||||
@@ -125,7 +123,7 @@ class OrderItemDao | |||||
public function getInfoById($id) { | public function getInfoById($id) { | ||||
try { | try { | ||||
$model = new OrderItem(); | $model = new OrderItem(); | ||||
$result = $model->where(["id" => $id])->find(); | |||||
$result = $model->where(["id" => $id])->find()->toArray(); | |||||
if ($result == null) { | if ($result == null) { | ||||
return Util::returnArrEr("获取子订单信息失败:" . $id); | return Util::returnArrEr("获取子订单信息失败:" . $id); | ||||
} | } | ||||
@@ -58,8 +58,8 @@ class OrderMainDao | |||||
try { | try { | ||||
$itemModel = new OrderItem(); | $itemModel = new OrderItem(); | ||||
$hotelModel = new OrderHotel(); | $hotelModel = new OrderHotel(); | ||||
$itemList = $itemModel->where(["order_id" => $orderId])->select(); | |||||
$hotelList = $hotelModel->where(["order_id" => $orderId])->select(); | |||||
$itemList = $itemModel->where(["order_id" => $orderId])->select()->toArray(); | |||||
$hotelList = $hotelModel->where(["order_id" => $orderId])->select()->toArray(); | |||||
$amount = 0; | $amount = 0; | ||||
$cost = 0; | $cost = 0; | ||||
foreach ($itemList as $item) { | foreach ($itemList as $item) { | ||||
@@ -87,7 +87,7 @@ class OrderMainDao | |||||
public function getInfoById($id) { | public function getInfoById($id) { | ||||
try { | try { | ||||
$orderMainModel = new OrderMain(); | $orderMainModel = new OrderMain(); | ||||
$orderMain = $orderMainModel->where(["id" => $id])->find(); | |||||
$orderMain = $orderMainModel->where(["id" => $id])->find()->toArray(); | |||||
if (null == $orderMain) { | if (null == $orderMain) { | ||||
return Util::returnArrEr("订单查询失败:".$id); | return Util::returnArrEr("订单查询失败:".$id); | ||||
} | } | ||||
@@ -106,11 +106,12 @@ class OrderMainDao | |||||
*/ | */ | ||||
public function setSubOrderShow($purchaseShow,$orderHotel,$orderItem){ | public function setSubOrderShow($purchaseShow,$orderHotel,$orderItem){ | ||||
$result = []; | $result = []; | ||||
foreach ($orderItem as $item) { | foreach ($orderItem as $item) { | ||||
$item['prod_type'] = 'item'; | $item['prod_type'] = 'item'; | ||||
foreach ($purchaseShow as $key=> $purchase) { | foreach ($purchaseShow as $key=> $purchase) { | ||||
if ($item['id'] == $key) { | if ($item['id'] == $key) { | ||||
array_merge($item,$purchase); | |||||
$item = array_merge($item,$purchase); | |||||
} | } | ||||
} | } | ||||
$result[] = $item; | $result[] = $item; | ||||
@@ -119,7 +120,7 @@ class OrderMainDao | |||||
$hotel['prod_type'] = 'hotel'; | $hotel['prod_type'] = 'hotel'; | ||||
foreach ($purchaseShow as $key=> $purchase) { | foreach ($purchaseShow as $key=> $purchase) { | ||||
if ($hotel['id'] == $key) { | if ($hotel['id'] == $key) { | ||||
array_merge($hotel,$purchase); | |||||
$hotel = array_merge($hotel,$purchase); | |||||
} | } | ||||
} | } | ||||
$result[] = $hotel; | $result[] = $hotel; | ||||
@@ -99,7 +99,7 @@ class PurchaseDao | |||||
public function setPurchaseAmount(int $purchaseId){ | public function setPurchaseAmount(int $purchaseId){ | ||||
try{ | try{ | ||||
$purchasePrice = new PurchasePrice(); | $purchasePrice = new PurchasePrice(); | ||||
$purchasePriceList = $purchasePrice->where(["purchase_id"=>$purchaseId,"del_flag"=>0])->select(); | |||||
$purchasePriceList = $purchasePrice->where(["purchase_id"=>$purchaseId,"del_flag"=>0])->select()->toArray(); | |||||
$cost = 0; | $cost = 0; | ||||
$amount = 0; | $amount = 0; | ||||
$cnt = 0; | $cnt = 0; | ||||
@@ -143,7 +143,7 @@ class PurchaseDao | |||||
public function getListByOrderId($orderId) { | public function getListByOrderId($orderId) { | ||||
$model = new Purchase(); | $model = new Purchase(); | ||||
try { | try { | ||||
$list = $model->where(["order_id" => $orderId, "del_flag" => 0])->select(); | |||||
$list = $model->where(["order_id" => $orderId, "del_flag" => 0])->select()->toArray(); | |||||
if (null == $list) { | if (null == $list) { | ||||
return Util::returnArrSu("",[]); | return Util::returnArrSu("",[]); | ||||
} | } | ||||
@@ -182,10 +182,7 @@ class PurchaseDao | |||||
$purchaseShow["purchasePriceList"][]=$priceShow; | $purchaseShow["purchasePriceList"][]=$priceShow; | ||||
} | } | ||||
} | } | ||||
if (null == $result[$purchase['order_detail_id']]) { | |||||
$result[$purchase['order_detail_id']] = []; | |||||
} | |||||
$result[$purchase['order_detail_id']][]= $purchaseShow; | |||||
$result[$purchase['order_detail_id']]= $purchaseShow; | |||||
} | } | ||||
return Util::returnArrSu("", $result); | return Util::returnArrSu("", $result); | ||||
} | } |
@@ -83,7 +83,7 @@ class PurchasePriceDao | |||||
public function getPurchasePriceListByOrderId($orderId) { | public function getPurchasePriceListByOrderId($orderId) { | ||||
$model = new PurchasePrice(); | $model = new PurchasePrice(); | ||||
try { | try { | ||||
$list = $model->where(["order_id" => $orderId, "del_flag" => $orderId])->select(); | |||||
$list = $model->where(["order_id" => $orderId, "del_flag" => 0])->select()->toArray(); | |||||
if (null == $list) { | if (null == $list) { | ||||
return Util::returnArrSu("", []); | return Util::returnArrSu("", []); | ||||
} | } | ||||
@@ -46,7 +46,7 @@ return [ | |||||
// 是否严格检查字段是否存在 | // 是否严格检查字段是否存在 | ||||
'fields_strict' => true, | 'fields_strict' => true, | ||||
// 数据集返回类型 | // 数据集返回类型 | ||||
'resultset_type' => 'array', | |||||
'resultset_type' => 'collection', | |||||
// 自动写入时间戳字段 | // 自动写入时间戳字段 | ||||
'auto_timestamp' => false, | 'auto_timestamp' => false, | ||||
// 时间字段取出后的默认时间格式,默认为Y-m-d H:i:s | // 时间字段取出后的默认时间格式,默认为Y-m-d H:i:s | ||||