# |
Oct 8th 2018, 18:48 |
nk-sonu |
because i can see its only giving object.. but i need mysql query like this "SELECT * from `seminars` where (DATE(specific_date) IN ('2018-10-24', '2018-10-25', '2018-10-29')) OR week_day IN (1,4,3,6)" |
# |
Oct 8th 2018, 18:47 |
nk-sonu |
is there any way in cakephp 3 to print raw mysql from cakephp query ? |
# |
Oct 8th 2018, 18:46 |
rightscoreanalysis |
sure: https://gist.github.com/spacebiscuit/92e6a99cd0cd45174f54b843660e2856 |
# |
Oct 8th 2018, 18:44 |
yuzl |
use pastebin/gist pls |
# |
Oct 8th 2018, 18:44 |
rightscoreanalysis |
I want to extraxt the strat_date and and end_date and put them in an index below the top/main |
# |
Oct 8th 2018, 18:43 |
slackebot |
<rightscoreanalysis> |
# |
Oct 8th 2018, 18:43 |
rightscoreanalysis |
hi anyone able to help with this: my collection is in this format |
# |
Oct 8th 2018, 18:39 |
yuzl |
someone here for help? |
# |
Oct 8th 2018, 18:39 |
yuzl |
hi guys. i'm having some troubles saving associated data |
# |
Oct 8th 2018, 18:34 |
beakman |
I know, I was building on top of your suggestion of using `IN`. |
# |
Oct 8th 2018, 18:33 |
edgaras.jan |
you can't ``` 'OR' => [ 'DATE(specific_date)' => '2018-10-24', 'DATE(specific_date)' => '2018-10-24', ] ``` |
# |
Oct 8th 2018, 18:32 |
edgaras.jan |
yes, only there is problem when you need same field (array key), then you need use subarray |
# |
Oct 8th 2018, 18:30 |
beakman |
I think the `'OR' => [...]` part is what he was looking for. |
# |
Oct 8th 2018, 18:29 |
beakman |
``` 'OR' => [ ['DATE(specific_date) IN ' => '2018-10-24', '2018-10-25], ['DATE(specific_date)' => '2018-10-24'], ['DATE(specific_date)' => '2018-10-24'], 'week_day IN' => [1,4,3,6], ] ``` |
# |
Oct 8th 2018, 18:28 |
edgaras.jan |
or if you wish first form ``` 'OR' => [ ['DATE(specific_date)' => '2018-10-24'], ['DATE(specific_date)' => '2018-10-24'], ['DATE(specific_date)' => '2018-10-24'], 'week_day IN' => [1,4,3,6], ] ``` |
# |
Oct 8th 2018, 18:25 |
edgaras.jan |
`SELECT * from `seminars` where (DATE(specific_date) IN ('2018-10-24', '2018-10-25', '2018-10-29')) OR week_day IN (1,4,3,6)` |
# |
Oct 8th 2018, 18:25 |
nk-sonu |
in dated we can use IN ? @edgaras.jan |
# |
Oct 8th 2018, 18:25 |
nk-sonu |
i am confused in "OR" |
# |
Oct 8th 2018, 18:24 |
edgaras.jan |
use `IN` |
# |
Oct 8th 2018, 18:24 |
slackebot |
<nk-sonu> |
# |
Oct 8th 2018, 18:21 |
nk-sonu |
hi. what to do if i want to search multiple dates compare in OR in mysql with same 1 field ? |
# |
Oct 8th 2018, 18:14 |
developer |
Hi Guys. Hope all doing well. I was stuck in cakephp or condition. I want to use multiple OR condition with 3 different dates from same field. |
# |
Oct 8th 2018, 16:46 |
ricksaccous |
actually i figured out the replace strat thing |
# |
Oct 8th 2018, 16:42 |
rrd564 |
and I want to sort after the grouping |
# |
Oct 8th 2018, 16:42 |
rrd564 |
The collection is after a groupBy |
# |
Oct 8th 2018, 16:41 |
rrd564 |
Is there a way to sort a collection by the index of its items? Something lige ksort for arrays? |
# |
Oct 8th 2018, 15:07 |
ricksaccous |
some of them require looking at matching data on other models |
# |
Oct 8th 2018, 15:07 |
ricksaccous |
because i only want deletions in the replace based on certain conditions |
# |
Oct 8th 2018, 15:07 |
ricksaccous |
because while i do want some replace-like behavior sometimes on this project there always seems to be some quirk to it |
# |
Oct 8th 2018, 15:06 |
ricksaccous |
I'd love for a more robust replace strategy |
# |
Oct 8th 2018, 14:56 |
ricksaccous |
in saveStrategy replace, would it be possible to set replace conditions or something? |
# |
Oct 8th 2018, 14:54 |
ricksaccous |
ok |
# |
Oct 8th 2018, 14:54 |
martin |
no, only in before :( |
# |
Oct 8th 2018, 14:53 |
ricksaccous |
but not in aftersave huh |
# |
Oct 8th 2018, 14:53 |
martin |
and the fields are dirty that are changed |
# |
Oct 8th 2018, 14:53 |
martin |
In the beforesave you have the orignal data |
# |
Oct 8th 2018, 14:52 |
ricksaccous |
actually i want to compare old data with new data |
# |
Oct 8th 2018, 14:52 |
ricksaccous |
is it possible to compare request data with data actually saved? |
# |
Oct 8th 2018, 14:51 |
ricksaccous |
in cakephp3 aftersave |
# |
Oct 8th 2018, 14:45 |
martin |
I know, walking tru the code now slowly checking where it stops :S |
# |
Oct 8th 2018, 14:44 |
ricksaccous |
good luck |