with(['goods', 'users' => ['user', 'sharingOrder']]) ->where('end_time', '<=', time()) ->where('status', '=', 10) ->select(); } /** * 设置拼单失败状态 * @param $activeIds * @return false|int */ public function updateEndedStatus($activeIds) { if (empty($activeIds)) { return false; } return $this->save(['status' => 30], ['active_id' => ['in', $activeIds]]); } }