Calling 2 different column values ​​in one column (search doesn't work)

QuestionsCalling 2 different column values ​​in one column (search doesn't work)
aytac asked 3 years ago

payee and payer are in the same column. What can I do to search within both.

$g->select_command = "SELECT id,code,date,payer,payee,amount_dvz,status,amount,kurkodu,accdes,type,accname from sys_transactions WHERE firmaid=$firmaid AND category='Havale'";

$col = array();
        $col["title"] = "Hesap Kartı";
        $col["name"] = "payee";
        $col["width"] = '100';
        $col["search"] = true;
        $col["on_data_display"] = array("display_stage_banka", "");
        function display_stage_banka($data)
        {

            $op = $data["payer"];
            $op2 = $data["payee"];

            if ($op!=''){
                return $op;
            }else{
                return $op2;

            }

        }

        $cols[] = $col;

1 Answers
Abu Ghufran Staff answered 3 years ago

You need to set it on
$col[“dbname”] = “if(payer!=”,payer,payee)”;

After that it will use above in WHERE clause when this field is filtered.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

6 + 8 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?