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 ]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,37 @@ class ReceptionForm extends Model
|
||||
'verifyCode' => 'Verification Code',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function preReadCard(){
|
||||
|
||||
$this->number = Helper::fixAsciiChars( $this->number );
|
||||
|
||||
$query = Card::find();
|
||||
$query->leftJoin("card_key_assignment", 'card.id_card = card_key_assignment.id_card');
|
||||
$query->leftJoin("key", 'key.id_key = card_key_assignment.id_key');
|
||||
|
||||
$query->andWhere(['or',
|
||||
['and',[ 'in','card.number' , [$this->number]],"trim(coalesce(card.number, '')) <>'' " ],
|
||||
['and', ['in','card.rfid_key' ,[ $this->number] ],"trim(coalesce(card.rfid_key, '')) <>'' "],
|
||||
['and',[ 'in','key.number' , [$this->number]],"trim(coalesce(key.number, '')) <>'' " ],
|
||||
['and', ['in','key.rfid_key' ,[ $this->number] ],"trim(coalesce(key.rfid_key, '')) <>'' "]
|
||||
|
||||
]);
|
||||
|
||||
$this->card = $query->one();
|
||||
|
||||
if ( $this->card == null ){
|
||||
|
||||
}
|
||||
|
||||
if ( $this->card != null ){
|
||||
$this->customer = $this->card->customer;
|
||||
$this->readValidTickets();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function readCard(){
|
||||
|
||||
$this->number = Helper::fixAsciiChars( $this->number );
|
||||
@@ -71,10 +101,7 @@ class ReceptionForm extends Model
|
||||
|
||||
$this->card = $query->one();
|
||||
|
||||
if ( $this->card == null ){
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ( $this->card != null ){
|
||||
$this->customer = $this->card->customer;
|
||||
$this->readValidTickets();
|
||||
|
||||
2
frontend/runtime/.gitignore
vendored
2
frontend/runtime/.gitignore
vendored
@@ -1,2 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
!.gitignore
|
||||
|
||||
Reference in New Issue
Block a user