| 1234567891011121314151617181920212223 |
- <?php
- namespace addons\BusinessCard\common\validate;
- use addons\BusinessCard\common\models\BusinessCardCustomerLog;
- class RelationValidate
- {
- /**
- * @param array $data [item_id, user_id, log_type, mall_id]
- * @return array|\yii\db\ActiveRecord|null
- */
- public static function valid(array $data)
- {
- return BusinessCardCustomerLog::find()
- ->where(['mall_id' => $data['mall_id']])
- ->andWhere(['item_id' => $data['item_id']])
- ->andWhere(['user_id' => $data['user_id']])
- ->andWhere(['log_type' => $data['log_type']])
- ->one();
- }
- }
|