예제 #1
0
파일: Order.php 프로젝트: mrwaim/OrderModel
 /**
  * Returns the order that has status = approved.
  *
  * @param $query
  *
  * @return mixed
  */
 public static function whereNotFulfilled($query)
 {
     $ret = $query->where(function ($q) {
         $q->where('order_status_id', '<>', OrderStatus::Shipped()->id)->Where('order_status_id', '<>', OrderStatus::FirstOrder()->id)->Where('order_status_id', '<>', OrderStatus::Rejected()->id)->Where('order_status_id', '<>', OrderStatus::PaymentUploaded()->id)->Where('order_status_id', '<>', OrderStatus::Cancelled()->id)->Where('order_status_id', '<>', OrderStatus::NewOrderStatus()->id)->Where('order_status_id', '<>', OrderStatus::Printed()->id);
     });
     return $ret;
 }
 public function createFirstOrder(User $user, ProofOfTransfer $proofOfTransfer, array $products, array $quantityHash, $isHq, $isPickup = false, $ipAddress)
 {
     assert($user, '$user');
     assert($user->id, '$user->id');
     $status = OrderStatus::FirstOrder()->id;
     return $this->createOrder($user, $proofOfTransfer, $products, $quantityHash, $status, null, $isHq, $isPickup, $ipAddress);
 }