with('hasOneCoupon') ->with('hasOneMember') ->where('status',0); } public static function updatedData($condition, $updatedData) { return self::where($condition) ->update($updatedData); } public function hasOneCoupon() { return $this->hasOne('app\common\models\Coupon', 'id', 'coupon_id'); } public function hasOneMember() { return $this->hasOne('app\common\models\Member', 'uid', 'uid'); } }