コード例 #1
0
ファイル: Transactions.php プロジェクト: eco-nomix/deployed
 public function loadProductInTransaction($newTrans, $userId, $role, $productId)
 {
     $product = Products::find($productId);
     if ($role == 1) {
         $cost = $product->member;
     } else {
         $cost = $product->non_member;
     }
     $pay_bonus = $product->pay_bonus;
     $detail = new \SalesTransactionDetails();
     $detail->transaction_id = $newTrans->id;
     $detail->date = now();
     $detail->purchased_by = $userId;
     $detail->amount = $cost;
     $detail->product_id = $productId;
     $detail->pay_bonus = $pay_bonus;
     $detail->shipping = $product->shipping_handling;
     $detail->save();
     $this->updateTransaction($newTrans, $detail);
     return $newTrans;
 }
コード例 #2
0
ファイル: Products.php プロジェクト: txowista/angulara
 /**
  * Remove the specified resource from storage.
  *
  * @param   $request
  * @return \Illuminate\Http\Response
  */
 public function destroy(Request $request)
 {
     $products = Products::find($request->input('id'));
     $products->delete();
     return "Products record successfully deleted #" . $products->input('id');
 }
コード例 #3
0
 public function destroy($id)
 {
     Products::find($id)->delete();
     return redirect()->route('products');
 }