# |
Dec 30th 2018, 13:23 |
challgren |
Ok a debug($query) would be better sorry |
# |
Dec 30th 2018, 13:23 |
kitcat711 |
https://gist.github.com/Kitcat711/6b440733f5566b243c946bdf047a99fa @challgren |
# |
Dec 30th 2018, 13:14 |
kitcat711 |
ok, right on it |
# |
Dec 30th 2018, 13:12 |
challgren |
If you can post that as a gist that would be helpful for me |
# |
Dec 30th 2018, 13:11 |
challgren |
You know you can put in sql($query) to see the sql that is generated |
# |
Dec 30th 2018, 13:09 |
challgren |
actually update your fields you have commented out and add `'balance' => 'IFNULL(ar.balance, 0)'` to the field list |
# |
Dec 30th 2018, 13:08 |
challgren |
1 min let me make a revision |
# |
Dec 30th 2018, 13:07 |
kitcat711 |
I mean as a field in the array result |
# |
Dec 30th 2018, 13:06 |
kitcat711 |
@challgren actually, no error, but I don’t get the ‘ar.balance’ I am seekeing |
# |
Dec 30th 2018, 13:02 |
rightscoreanalysis |
scrap that calling the param form the wrong template :slightly_smiling_face: |
# |
Dec 30th 2018, 13:01 |
challgren |
Did that work @kitcat711? |
# |
Dec 30th 2018, 12:57 |
rightscoreanalysis |
I followed the example in the book |
# |
Dec 30th 2018, 12:57 |
rightscoreanalysis |
Warning (2): Missing argument 1 for... |
# |
Dec 30th 2018, 12:57 |
rightscoreanalysis |
however if I debug the param in my cell: public function display($id) { debug($id); |
# |
Dec 30th 2018, 12:57 |
rightscoreanalysis |
I'm trying to pass a variable to my cell with: <?= $this->cell('LatestArticle', [$article->id]); ?> |
# |
Dec 30th 2018, 12:55 |
challgren |
Let me know if it works |
# |
Dec 30th 2018, 12:55 |
kitcat711 |
Thanks @challgren |
# |
Dec 30th 2018, 12:55 |
kitcat711 |
thanks, trying right away |
# |
Dec 30th 2018, 12:54 |
kitcat711 |
Yes, I am not sure that I need it, but this is what I am investingating. The difficulty, to me, is that is it refering to AccountingRecords Table, apart from the current join or selet |
# |
Dec 30th 2018, 12:54 |
challgren |
Granted completely untested since I dont have access to the DB or any example data |
# |
Dec 30th 2018, 12:53 |
challgren |
@kitcat711 checkout https://gist.github.com/challgren/a50da07c50da2a6a7b3350dc728f5950 |
# |
Dec 30th 2018, 12:47 |
challgren |
https://book.cakephp.org/3.0/en/orm/query-builder.html#subqueries |
# |
Dec 30th 2018, 12:45 |
challgren |
Is that what I’m understaindg? |
# |
Dec 30th 2018, 12:44 |
challgren |
So line 28 on your gist you need a subquery? |
# |
Dec 30th 2018, 12:44 |
challgren |
Nevermind on the “You ar array should just be an array and not have the key ar….” |
# |
Dec 30th 2018, 12:43 |
kitcat711 |
nm? |
# |
Dec 30th 2018, 12:43 |
kitcat711 |
@challgren: reading it, so far was trying with function($q) and subqueries, but nothing worked so I am ready to investigate the leftjoinWith |
# |
Dec 30th 2018, 12:43 |
challgren |
actually nm |
# |
Dec 30th 2018, 12:40 |
challgren |
You ar array should just be an array and not have the key ar. You also need `'alias' => 'ar'` |
# |
Dec 30th 2018, 12:37 |
challgren |
@kitcat711 checkout https://book.cakephp.org/3.0/en/orm/query-builder.html#using-leftjoinwith |
# |
Dec 30th 2018, 12:31 |
kitcat711 |
Hello there, Trying, for hours, to implement a “complex” SQL Left join using CakePHP 3.6.13, please can you drive me and glance this : https://gist.github.com/Kitcat711/6b440733f5566b243c946bdf047a99fa . Thanks |
# |
Dec 30th 2018, 12:09 |
challgren |
@birdy247 this looks interesting https://book.cakephp.org/3.0/en/console-and-shells.html#index-0 |
# |
Dec 30th 2018, 12:08 |
k4t |
@admad u there maybe? |
# |
Dec 30th 2018, 12:06 |
challgren |
Yep I know, Ive been trying to model my stuff after the migrations plugin |
# |
Dec 30th 2018, 12:06 |
birdy247 |
So I am keen to move to commands |
# |
Dec 30th 2018, 12:05 |
birdy247 |
@challgren but this also means shells will likley not benefit from any new features :slightly_smiling_face: |
# |
Dec 30th 2018, 12:04 |
challgren |
I know its somethign Ive been struggling with |
# |
Dec 30th 2018, 12:01 |
challgren |
@birdy247 I dont think so yet, but Shells wont be removed until 5.x |
# |
Dec 30th 2018, 11:56 |
birdy247 |
Is there a way to neatly package them up, or should I make a AdminCommand which then provides options which can call other commands |
# |
Dec 30th 2018, 11:55 |
birdy247 |
with commands, I find myself creating a new one for each task |
# |
Dec 30th 2018, 11:55 |
birdy247 |
etc.. |