add feature enable/disable reception door log
This commit is contained in:
@@ -6,7 +6,6 @@ use frontend\models\TowelForm;
|
||||
use Yii;
|
||||
use common\models\Customer;
|
||||
use frontend\models\ReceptionForm;
|
||||
use frontend\models\CustomerSearch;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
@@ -14,7 +13,6 @@ use common\models\Card;
|
||||
use frontend\models\CustomerUpdate;
|
||||
use frontend\models\CustomerCreate;
|
||||
use common\models\Image;
|
||||
use yii\base\Exception;
|
||||
use common\models\Log;
|
||||
|
||||
/**
|
||||
@@ -56,15 +54,13 @@ class CustomerController extends Controller
|
||||
$model->number = $number;
|
||||
|
||||
$model->readCard();
|
||||
$model->mkDoorLog();
|
||||
// $model->mkDoorLog();
|
||||
|
||||
if ( $model->isFreeCard() ){
|
||||
return $this->redirect([ 'create', 'number' => $model->card->number ]);
|
||||
}else if ( $model->isCardWithKey()){
|
||||
return $this->redirect([ 'product/sale', 'number' => $model->card->number ]);
|
||||
}else if ( $model->isCustomerWithTicket()){
|
||||
// return $this->redirect([ 'product/sale', 'number' => $model->card->number ]);
|
||||
// return $this->redirect([ 'customer/reception', 'number' => $model->card->number ]);
|
||||
}else if ( $model->isCardWithCustomer() ){
|
||||
return $this->redirect([ 'ticket/create', 'number' => $model->card->number ]);
|
||||
}
|
||||
@@ -72,38 +68,6 @@ class CustomerController extends Controller
|
||||
return $this->render('reception',['model' => $model]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Lists all Customer models.
|
||||
* @return mixed
|
||||
*/
|
||||
/*
|
||||
public function actionIndex()
|
||||
{
|
||||
$searchModel = new CustomerSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
return $this->render('index', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
}
|
||||
*/
|
||||
/**
|
||||
* Displays a single Customer model.
|
||||
* @param null $number
|
||||
* @return mixed
|
||||
* @internal param int $id
|
||||
*/
|
||||
/*
|
||||
public function actionView($id)
|
||||
{
|
||||
return $this->render('view', [
|
||||
'model' => $this->findModel($id),
|
||||
]);
|
||||
}
|
||||
*/
|
||||
|
||||
public function actionTowel($number = null)
|
||||
{
|
||||
@@ -185,7 +149,9 @@ class CustomerController extends Controller
|
||||
if ( $number != null ){
|
||||
$card = Card::readCard($number);
|
||||
if ( $card != null ){
|
||||
$model = CustomerUpdate::find()->innerJoin(Card::tableName(), "customer.id_customer_card = card.id_card")->andWhere( [ 'customer.id_customer_card' => $card->id_card ])->one();
|
||||
$model = CustomerUpdate::find()
|
||||
->innerJoin(Card::tableName(), "customer.id_customer_card = card.id_card")
|
||||
->andWhere( [ 'customer.id_customer_card' => $card->id_card ])->one();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,25 +205,6 @@ class CustomerController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// s
|
||||
|
||||
/**
|
||||
* Deletes an existing Customer model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
/*
|
||||
public function actionDelete($id)
|
||||
{
|
||||
$this->findModel($id)->delete();
|
||||
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
*/
|
||||
/**
|
||||
* Finds the Customer model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
|
||||
@@ -103,11 +103,9 @@ class KeyController extends Controller
|
||||
if ( isset( $model->keyCard ) ){
|
||||
return $this->redirect(['product/sale', 'number' => $model->keyCard->number ]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return $this->redirect(['customer/reception', 'number' => $number ]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user