add rest application and discount-status rest method
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
use yii\db\ActiveRecord;
|
||||
use yii\db\Query;
|
||||
use yii\db\Expression;
|
||||
use common\components\Helper;
|
||||
@@ -241,18 +240,23 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \common\models\Card $card the card to which we are looking for
|
||||
*
|
||||
* @return array|\yii\db\ActiveRecord[]
|
||||
*/
|
||||
public static function readActive($card){
|
||||
/**
|
||||
* @param \common\models\Card $card the card to which we are looking for
|
||||
*
|
||||
* @param \DateTime $validOnDay on which day must be the ticket valid
|
||||
* @return array|\yii\db\ActiveRecord[]
|
||||
*/
|
||||
public static function readActive($card, $validOnDay = null){
|
||||
|
||||
if ( $card == null )
|
||||
return [];
|
||||
|
||||
$query = Ticket::find();
|
||||
$today = date('Y-m-d');
|
||||
if (!isset( $validOnDay ) ){
|
||||
$today = date('Y-m-d');
|
||||
}else{
|
||||
$today = $validOnDay->format('Y-m-d');
|
||||
}
|
||||
|
||||
$query->andWhere(['ticket.id_card' => $card->id_card]);
|
||||
$query->andWhere( 'ticket.start <= :today' ,[ 'today' => $today] );
|
||||
|
||||
@@ -71,6 +71,8 @@ class User extends ActiveRecord implements IdentityInterface
|
||||
*/
|
||||
public static function findIdentityByAccessToken($token, $type = null)
|
||||
{
|
||||
$authorization = base64_decode($token);
|
||||
\Yii::info("findIdentityByAccessToken", $authorization);
|
||||
throw new NotSupportedException('"findIdentityByAccessToken" is not implemented.');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user