add product sell discount js changes

This commit is contained in:
2015-10-20 17:23:52 +02:00
parent 1a1477b26b
commit f2e30779f0
10 changed files with 165 additions and 90 deletions

View File

@@ -12,14 +12,22 @@ use common\models\MoneyMovement;
*/
class MoneyMovementSearch extends MoneyMovement
{
public $start;
public $end;
public $timestampStart;
public $timestampEnd;
/**
* @inheritdoc
*/
public function rules()
{
{
return [
[['id_money_movement', 'id_account', 'id_user', 'type', 'money'], 'integer'],
[['name', 'comment', 'created_at', 'updated_at'], 'safe'],
[[ 'start', ], 'date', 'format' =>Yii::$app->formatter->datetimeFormat , 'timestampAttribute' => 'timestampStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd HH:mm' ,'timeZone' => 'UTC' ],
[[ 'end' , ], 'date' ,'format' =>Yii::$app->formatter->datetimeFormat , 'timestampAttribute' => 'timestampEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd HH:mm' ,'timeZone' => 'UTC' ],
];
}
@@ -51,22 +59,13 @@ class MoneyMovementSearch extends MoneyMovement
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
$query->where('0=1');
return $dataProvider;
}
$query->andFilterWhere([
'id_money_movement' => $this->id_money_movement,
'id_account' => $this->id_account,
'id_user' => $this->id_user,
'type' => $this->type,
'money' => $this->money,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'name', $this->name])
->andFilterWhere(['like', 'comment', $this->comment]);
$query->andFilterWhere([ '>=', 'money_movement.created_at', $this->timestampStart ] );
$query->andFilterWhere([ '<', 'money_movement.created_at', $this->timestampEnd ] );
return $dataProvider;
}