/** * Find unique user by username * * @param string $username * @return static|null */ public static function findUniqueTO($transactionId, $customerCode, $inboundNo, $palletNo) { $handlingUnit = TrxHandlingUnit::find()->where(['transaction_id' => $transactionId, 'customer_code' => $customerCode, 'inbound_no' => $inboundNo, 'pallet_no' => $palletNo, 'inbound_status' => [Yii::$app->params['STATUS_PROCESS'], Yii::$app->params['STATUS_CLOSED']]])->one(); return $handlingUnit; }
public function getHandlingUnit($conditions = null) { // to retrieve all *active* transactions by their index and order them by their ID: $model = TrxHandlingUnit::find()->where($conditions)->one(); return $model; }