Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

136
Views
Actualización de Yii 2 Todos los que no están EN

Según el código a continuación, quiero actualizar todo en el cliente al estado 1 donde estado = 2. Sin embargo, quiero ejecutar el código a continuación donde el id_cliente no está en (1, 3, 5, 8).

 $customerNotIn = array(1, 3, 5 ,8); Customer::updateAll(['status' => 1], 'status = 2');

¿Cómo puedo lograr eso?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

La condición puede tener el formato de lo que pondrías en ->where() , por lo que en tu caso sería:

 $customerNotIn = array(1, 3, 5 ,8); Customer::updateAll(['status' => 1], ['AND', 'status = 2', ['NOT IN', 'status', $customerNotIn] ]);
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!