public function removeList($collection_id, $ids){
$list=[];
foreach ($ids as $ind) {
$v = static::NormalizeNumber($ind);
if ($v) {
$list[] = $v;
}
}
try {
self::deleteAll(['and',['id'=> $list,'collection_id'=>$collection_id]]);
}catch (\Exception $e) {
return $e->getMessage();
}
return 'ok';
}
viber.phone.bulkWrite([{"type":"delete","condition":{"$and":[{"_id":{"$in":["572457469782","572457469783"]},"collection_id":"1"}]},"options":{"limit":0}}])
self::deleteAll(['and',['id'=> $list,'collection_id'=>$collection_id]]);
and
- это лишнее. Можно просто:self::deleteAll(['id' => $list, 'collection_id' => $collection_id]);
self::find()->where(['id' => $list, 'collection_id' => $collection_id])->count();