Dear Team, I need a small help on how to write a query in value metrics function. And below is my requirement.
I need to display the sum/count of the payment done by different payment modes like cash,card and cheque by value metrics functionality.
payment type (column name) and we will store the id of different payment types like 1(id) - cash, 2(id) - card and 3(id) - cheque.
And for that i need to join the above table with other table to print the name of the payment type.
so now how can i implement the above requirement for value metric functionality.
<?php
use \koolreport\dashboard\metrics\Value;
use \koolreport\dashboard\fields\Date;
use \koolreport\dashboard\fields\Number;
class PaymentTable extends Value
{
protected function dataSource()
{
return AutoMaker::table("table name");
}
protected function fields()
{
return [
Date::create("Cloumn name"),
$this->sum(
Number::create("Cloumn name")
),
$this->sum(
Number::create("Cloumn name")
),
];
}
}
Please help me