нужно сделать фильтр операций пользователя (по платежной системе, статусу и типу операции). Дабы не писать кучу кода
хотел воспользоваться DataProvider->criteria->compare();
Но вылезла ошибка, чувствую что мелочь...найти не могу...Подскажите плз
модель
Код: Выделить всё
<?php
namespace app\models;
use Yii;
/**
* This is the model class for table "operation".
*
* @property string $id
* @property string $paysystem Название платежной системы
* @property string $refer_money реферальные
* @property string $put_money Внесено
* @property string $deposit Депозит
* @property string $accured Начислено
* @property string $withdraw Выведено
* @property string $created_at дата операции
* @property string $user_id пользователь
*/
class Operation extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'operation';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['paysystem', 'refer_money', 'put_money', 'deposit', 'uniqid', 'accured', 'withdraw', 'user_id'], 'required'],
[['created_at'], 'safe'],
[['user_id'], 'integer'],
[['paysystem'], 'string', 'max' => 30],
[['refer_money', 'put_money', 'deposit', 'accured', 'withdraw'], 'string', 'max' => 20],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'paysystem' => 'Paysystem',
'refer_money' => 'Refer Money',
'put_money' => 'Put Money',
'deposit' => 'Deposit',
'accured' => 'Accured',
'withdraw' => 'Withdraw',
'created_at' => 'Created At',
'user_id' => 'User ID',
'uniqid'=>'uniqid',
];
}
}
Код: Выделить всё
$opert = new Operation();
//$this->debug($_POST);die;
$operation = new ActiveDataProvider($opert);
Setting unknown property: yii\data\ActiveDataProvider::uniqid - сама ошибка. Что не так?