+ Update lastTransactions fields v2
This commit is contained in:
parent
8a8e9f5442
commit
71270c8e88
|
@ -12,6 +12,7 @@ use App\Models\WalletTransaction;
|
||||||
use App\Traits\ApiResponser;
|
use App\Traits\ApiResponser;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class TransactionController extends Controller
|
class TransactionController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -153,7 +154,7 @@ class TransactionController extends Controller
|
||||||
|
|
||||||
public function lastTransactions($id_wallet){
|
public function lastTransactions($id_wallet){
|
||||||
$transactions = WalletTransaction::where('id_wallet',$id_wallet)->orderBy('date','desc')->limit(10)
|
$transactions = WalletTransaction::where('id_wallet',$id_wallet)->orderBy('date','desc')->limit(10)
|
||||||
->get(['id', 'montant' ,'numCarte AS destinataire' ,'commission_ag', 'type' ,'date']);
|
->get(['type' ,DB::raw('\'wallet\' as source'), 'montant' ,'numCarte AS destinataire' , 'date', 'id']);
|
||||||
return $this->successResponse($transactions);
|
return $this->successResponse($transactions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue