orderOptionCateringLogModel ->where('cycle_id',$this->cycleId) ->where('kitchen_id',$this->kitchenId) ->select(['site_id','quantity','status','id']) ->get(); $res = $this->buildResArr($cycleCateringLogs); if (empty($res)) return $this->return->success('success',['list' => []]); return $this->return->success('success',['list' => array_values($res)]); } /** * @return array */ public function remainCount(): array { $count = $this->orderOptionCateringLogModel ->where('cycle_id',$this->cycleId) ->where('kitchen_id',$this->kitchenId) ->where('status',OrderCode::CATERING_STATUS_UNDERWAY) ->sum('quantity') ?? 0; return $this->return->success('success',['count' => $count]); } }