/** * show Statuses */ public function getStatuses($paginateItems = 50) { app('veer')->loadedComponents['counted']['orders'] = \Veer\Models\Order::select(\DB::raw('count(*) as orders_count, status_id'))->groupBy('status_id')->lists('orders_count', 'status_id'); app('veer')->loadedComponents['counted']['orders_history'] = \Veer\Models\OrderHistory::select(\DB::raw('count(*) as orders_count, status_id'))->groupBy('status_id')->lists('orders_count', 'status_id'); app('veer')->loadedComponents['counted']['bills'] = \Veer\Models\OrderBill::select(\DB::raw('count(*) as orders_count, status_id'))->groupBy('status_id')->lists('orders_count', 'status_id'); return \Veer\Models\OrderStatus::orderBy('manual_order', 'asc')->paginate($paginateItems); }
/** * Query Builder: * * - who: 1 Bill * - with: * - to whom: make() | order/bills/{id} * * @later: 'order', 'user', 'status', 'payment' */ public function getBillWithSite($siteId, $id, $lnk, $userId = null, $bypassUser = false) { $items = \Veer\Models\OrderBill::where('link', '=', $lnk)->where('id', '=', $id); if (!$bypassUser) { $items->where('users_id', '=', $userId)->where('sites_id', '=', $siteId); } return $items->first(); }
public function delete($id) { \Veer\Models\Order::where('payment_method_id', '=', $id)->update(['payment_method_id' => 0]); \Veer\Models\OrderBill::where('payment_method_id', '=', $id)->update(['payment_method_id' => 0]); \Veer\Models\OrderPayment::destroy($id); event('veer.message.center', trans('veeradmin.payment.delete') . " " . $this->restore_link('OrderPayment', $id)); return $this; }
/** * delete Status */ public function delete($id) { \Veer\Models\Order::where('status_id', '=', $id)->update(['status_id' => 0]); \Veer\Models\OrderBill::where('status_id', '=', $id)->update(['status_id' => 0]); \Veer\Models\OrderHistory::where('status_id', '=', $id)->update(['status_id' => 0]); \Veer\Models\OrderStatus::destroy($id); event('veer.message.center', trans('veeradmin.status.delete') . " " . $this->restore_link('OrderStatus', $id)); return $this; }
public function delete() { \Veer\Models\OrderBill::where('id', '=', $this->id)->delete(); return $this; }