本文整理汇总了PHP中Transaction::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Transaction::all方法的具体用法?PHP Transaction::all怎么用?PHP Transaction::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transaction
的用法示例。
在下文中一共展示了Transaction::all方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: subscriptions
/**
* @before _secure, memberLayout
*/
public function subscriptions()
{
$this->seo(array("title" => "Subscriptions", "keywords" => "admin", "description" => "admin", "view" => $this->getLayoutView()));
$view = $this->getActionView();
$subscriptions = Subscription::all(array("user_id = ?" => $this->user->id), array("item_id", "created", "expiry"));
$transactions = Transaction::all(array("user_id = ?" => $this->user->id), array("property", "property_id", "payment_id", "amount", "created"), "created", "desc");
$view->set("subs", $subscriptions);
$view->set("transactions", $transactions);
}
示例2: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$transactions = Transaction::orderBy('date_purchased', 'desc')->orderBy('created_at', 'desc')->take(10)->get();
$total_spent = Transaction::all()->sum('amount');
//pull n_total and i_total
$n_total = User::where('firstname', '=', 'Nathanael')->first()->transactions->sum('amount');
$i_total = User::where('firstname', '=', 'IndiAna')->first()->transactions->sum('amount');
$i_diff = $i_total - $total_spent / 2;
$n_diff = $n_total - $total_spent / 2;
return View::make('transactions.index')->with('transactions', $transactions->reverse())->with('total_spent', $total_spent)->with('n_total', $n_total)->with('i_total', $i_total)->with('i_diff', $i_diff)->with('n_diff', $n_diff);
}
示例3: index
/**
* Display a listing of the resource.
* This route will be called automatically on a GET on the base path
*
* @return Response
*/
public function index()
{
$transactions = Transaction::all();
return Response::json($transactions);
}
示例4: show
/**
* Display the specified resource.
* GET /transactions/{id}
*
* @param int $id
* @return Response
*/
public function show($id)
{
return Transaction::all();
}
示例5: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$transactions = $this->transaction->all();
return View::make('admin.transactions.index', compact('transactions'));
}
示例6: transactions
/**
* @before _secure, _admin
*/
public function transactions()
{
$this->seo(array("title" => "Transactions", "view" => $this->getLayoutView()));
$view = $this->getActionView();
$page = RequestMethods::get("page", $page);
$limit = RequestMethods::get("limit", $limit);
$transactions = Transaction::all(array(), array("user_id", "property", "property_id", "payment_id", "amount", "created"), "created", "desc", $limit, $page);
$view->set("transactions", $transactions);
$view->set("page", $page);
$view->set("limit", $limit);
$view->set("count", Transaction::count());
}