columns(['customer_id', 'st.id, st.item_id', 'st.item_name', 'st.item_image', 'st.quantity', 'st.price', 'st.item_url', 'st.item_image']) ->rightJoin('spyStore', 'st.spy_event_id = SpyEvent.id', 'st') ->where("project_id = :project_id:") ->andWhere("action ='order_add'") ->andWhere("customer_id =$customer_id") ->bind(array("project_id" => $project_id)) ->execute(); } public function getSpyUsers($modelsManager, $project, $time) { $now = date("Y-m-d H:i:s"); $date1 = new DateTime($now); $date1->modify($time); $date1 = $date1->format('Y-m-d H:i:s'); $phql = "SELECT DISTINCT (customer_id) as id FROM SpyEvent WHERE project_id = {$project->id} AND action = 'order_add' AND date <= '{$date1}'"; //�������� ��� ���� ��� �������� ������� // AND action = 'order_add' AND date <= '{$date}' return $modelsManager->executeQuery($phql)->toArray(); } }