/
home
/
henzagold
/
server
/
app
/
Http
/
Controllers
/
Customer
/
File Upload :
llllll
Current File: /home/henzagold/server/app/Http/Controllers/Customer/CustomerController.php
<?php namespace App\Http\Controllers\Customer; use App\Http\Controllers\Controller; use App\Models\SingleCustomerOrders; use App\Models\WebServiceGold; use Illuminate\Http\Request; use Rooyesh\Wallet\models\Transaction; use Rooyesh\Wallet\models\Wallet; class CustomerController extends Controller { public function getWallet(){ $wallet = Wallet::where('owner',auth()->id()) ->select(['id','gold','credit']) ->first(); $wallet['gold_toman'] = $wallet['gold'] * WebServiceGold::getPriceGold18Ayar(); return response()->json($wallet); } public function detailWallet(Request $request){ $records = Transaction::with(['order'=>function($q){ return $q->select(['id','sts',SingleCustomerOrders::$SELECT_CAJ,SingleCustomerOrders::$SELECT_STS_STR]); }])->select([ 'value','expire_at','note','customer_id','order_id','id','transaction_type' ])->where('customer_id',auth()->id()) ->orderBy('id','desc'); return response()->json($this->addLimit($records,$request->all())); // return response()->json($records->get()); } }
Copyright ©2k19 -
Hexid
|
Tex7ure